Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Curtis Rueden
    @ctrueden
    Has anybody requested support for ScanImage TIFF files in Bio-Formats yet? If not, LOCI may implement this.
    Josh Moore
    @joshmoore
    I don’t see any mention of it @ctrueden
    Curtis Rueden
    @ctrueden
    Thanks @joshmoore. One of our local scientists here will work toward supporting it. It's just TIFF files with metadata in the ImageDescription, similar to other TIFF variants. He will use ImprovisionTiffReader as a model, and we will submit a PR + sample data when ready.
    Josh Moore
    @joshmoore
    Understood, @ctrueden. Cheers.
    wongmac
    @wongmac
    where can I download the java package (what is it called)for the bioformats library so I can use the SVSReader in loci.formats.in inside of eclipse because the only package i've downloaded seems to be used for imageJ only(http://downloads.openmicroscopy.org/bio-formats/5.1.10/)
    Josh Moore
    @joshmoore
    hi @wongmac — instructions for using Eclipse are available at https://www.openmicroscopy.org/site/support/bio-formats5.1/developers/building-bioformats.html?highlight=eclipse#eclipse though these assume you are building from source. If you are using maven in Eclipse, then you can list Bio-Formats as a dependency, though you’ll need to point to non-standard repository.
    Curtis Rueden
    @ctrueden
    I second the suggestion to use Maven. You could look at https://github.com/fiji/fiji for an example of including Bio-Formats. You need the formats-gpl component in particular.
    wongmac
    @wongmac
    How can I set the current file so I can uses the svs reader of the bioformats library? https://downloads.openmicroscopy.org/bio-formats/5.1.0/api/loci/formats/IFormatReader.html#getCurrentFile()
    Curtis Rueden
    @ctrueden
    @wongmac OK, here we are! Let me dig up the example for you.
    Here is where it reads bytes from one plane at a time in a loop.
    And here is where it assigns the filename to the reader, using the setId method. The file format is autodetected from the contents of the file.
    wongmac
    @wongmac
    @ctrueden No I haven't, thank you!
    Curtis Rueden
    @ctrueden
    That example is pretty comprehensive. In fact, it is the code for the showinf command line tool.
    If anything is not clear in there, let us know here, and we will explain. Good luck. :-)
    Note that that example does a lot of extra stuff you probably don't need for your use case, like wrapping up the reader in some layers.
    For you, it is likely enough to just do:
    ImageReader r = new ImageReader();
    r.setId("/path/to/my.svs");
    for (int s=0; s<r.getSeriesCount(); r++) {
      r.setSeries(s);
      for (int i=0; i<r.getImageCount(); i++) {
        byte[] plane = r.openBytes(i);
      }
    }
    And if you need to extract metadata, there are various ways of doing that; see this page for a primer.
    wongmac
    @wongmac
    @ctrueden thank you so much! that's exactly what I needed :)
    Curtis Rueden
    @ctrueden
    @wongmac You're welcome. :-)
    wongmac
    @wongmac
    @ctrueden it works perfectly, but as you said the array of bytes cannot hold the files that large of the svs. Is there anyway to gather the data into say a matrix of the values or something that could hold it all?
    Curtis Rueden
    @ctrueden
    @wongmac You can use SCIFIO to read an ImageJ2 Dataset object. This API is not yet stable but it is working.
    wongmac
    @wongmac
    How can I decode the byte array returned by openBytes into the RGB values of each pixel inside of the given sub image. How do the byte arrays store the data?
    Curtis Rueden
    @ctrueden
    @wongmac You probably want loci.common.DataTools.makeDataArray and loci.common.DataTools.makeDataArray2D!
    You need to ask the reader for the bits per pixel, type, etc., unfortunately. But it is doable.
    wongmac
    @wongmac
    does the make2DDataArray function given by the DataTools class allow me to retrieve the RGB values somehow? (what data type is stored inside of the array) and how can I retrieve the rgb or hsi values from the byte array returned by open bytes? (Sorry for the noob questions, I'm extremely new to this, and have never worked with complex image types)
    Curtis Rueden
    @ctrueden
    It's been a long time since I have looked at that code, but my guess is it will come back as packed RGBA ints. Or else three separate byte channels. You can check via instanceof.
    Maybe someone else can clarify further; sleepy time for me.
    David Gault
    @dgault
    Hi, just following up on the suggestions that Curtis had made, if you are using the make2DDataArray function then you will receive back a 2d array. The function requires the following parameters: makeDataArray2D(byte[] b, int bpp, boolean fp, boolean little, int height)