Re: TiffForm getRangeSets missing...

Hi Octavian,

Sorry for the delay in my reply.

The reason getRangeSets is missing is because TiffForm returns image
planes as ImageFlatFields (which are FlatFields backed by Java
BufferedImages), and ImageFlatField does not implement getRangeSets.
However, I would be surprised if you need this functionality for what
you describe, since my understanding is that you are looking for the X
and Y resolution of your image planes (i.e., number of rows and
columns), which is stored as part of the domain set.

It sounds like what you want to do is load a TIFF file, then visualize
it. The easiest way to do so is to let VisAD autoscale your X and Y
axes based on the data. You can check out the testRead method of
visad.data.bio.LociForm for an example of how to do it, or see it in
action by running:
   java visad.data.tiff.TiffForm /path/to/my/data.tiff

If you need it, here is some code to extract number of rows and
columns from a single-page TIFF file:

TiffForm tiffForm = new TiffForm();
FlatField data = (FlatField) tiffForm.open("/path/to/my/data.tiff");
GriddedSet domainSet = (GriddedSet) data.getDomainSet();
int[] len = domainSet.getLengths();
System.out.println("TIFF image is " + len[0] + " x " + len[1] + " pixels.");

If I have misunderstood your question and you do need the getRangeSets
method with ImageFlatField, let me know and I can implement it for
you. And please do not hesitate to ask if you have any further
questions about VisAD.

-Curtis


On 5/27/07, Curtis Rueden <ctrueden@xxxxxxxx> wrote:
Hi Octavian,

I am the author of TiffForm, but am currently on vacation through
early June. I'll look into it when I return.

-Curtis

On 5/25/07, Octavian Iercan <octavian.iercan@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi All,
>
>
> I've been trying to read *.tif files in VisAD using TiffForm. Everything
> went well but the thing is that now I can't really visualize this image
> without having to give the number of columns and row in "hard code":
>
> Set resample_Set = new Linear2DSet(domain,
>
> 0, 1196=Nr. of rows, 100,
>
> 0, 2374=Nr. of columns, 100);
>
> Can somebody help me with this?
>
> Thanks!
>
> Octavian
>
> --
> Dipl.-Ing. Octavian Iercan
> Dep. Remote Sensing and Landscape Information Systems
> University Freiburg
> Tennenbacherstr. 4, D-79106 Freiburg
> Germany
> Tel: +49 761 203 3699
> Fax: +49 761 203 3701
>
> Homepage:http://portal.uni-freiburg.de/felis/Members/oi30/
> The NaturNet-Redime Project:http://naturnet.org
>
> ==============================================================================
> To unsubscribe visad, visit:
> http://www.unidata.ucar.edu/mailing-list-delete-form.html
> ==============================================================================
>
>


==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


  • 2007 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: