Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Mark Hiner
    @hinerm
    And are you just trying to recover the metadata? Or is there something that's trying to use physical pixel sizes and they're not being reported?
    I have to admit I don't remember the difference between pixelSize and physicalPixelSize...
    Curtis Rueden
    @ctrueden
    Pixel size = dimensional length. Physical pixel size = calibration.
    At least... I think :-)
    The FLIMJ project needs the physical calibration of the LIFETIME dimension to display a properly calibrated decay plot. We need to know if, e.g., the values range from 0 to 10 ns, or 0 to 12.5 ns, or something else. Regardless of the number of actual time bins along that dimension.
    Mark Hiner
    @hinerm
    but the axes are the dimensional lengths right?
    Curtis Rueden
    @ctrueden
    The CalibratedAxis classes of ImageJ2 support physical calibration in real space. Here we want SCIFIO to provide a LinearAxis for LIFETIME with the right calibration.
    Dasong Gao
    @Xanthorapedia
    Thanks for the explanation. Yes, CalibratedAxis is what I used to extract scales from other formats such as SDT. The ICS in question does have a parameter scale tag with 3 1.000000s, which are currently (supposedly) interpreted as the physical separation between pixels/layers. Though they are not because of a potential bug in the line reading stage, which causes this key not to be recognized and the default value of all 1.0's are used. I can supply more details if you are interested.
    Dasong Gao
    @Xanthorapedia
    Although parameter scale is meant to be the default place to define the physical sizes in the original paper, page 9, I see Bio-Formats uses history extent (overall dimensions of the dataset) to infer the physical pixel sizes if parameter scale is not present.
    if (scales != null) {
        // ...
    
        for (int i = 0; i < scales.length; i++) {
            Double scale = scales[i];
            // ...
            if (axis.equals("x")) {
                if (checkUnit(unit, "um", "microns", "micrometers")) {
                    Length x = FormatTools.getPhysicalSizeX(scale);
                    if (x != null) {
                        store.setPixelsPhysicalSizeX(x, 0);
                    }
                }
            }
            // process y and z axis in the same way
            // ...
            else if (axis.equals("t") && scale != null) {
                if (checkUnit(unit, "ms")) {
                    store.setPixelsTimeIncrement(new Time(scale, UNITS.MILLISECOND), 0);
                } else if (checkUnit(unit, "seconds") || checkUnit(unit, "s")) {
                    store.setPixelsTimeIncrement(new Time(scale, UNITS.SECOND), 0);
                }
            }
        }
    } else if (sizes != null) {
        if (sizes.length > 0) {
            Length x = FormatTools.getPhysicalSizeX(sizes[0]);
            if (x != null) {
                store.setPixelsPhysicalSizeX(x, 0);
            }
        }
        if (sizes.length > 1) {
            // process y axis
        }
    }
    from here, where scales are parsed from parameter scale and sizes are parsed from history extents.
    Curtis Rueden
    @ctrueden
    @Xanthorapedia It sounds like you have a pretty good idea what's going on. Do you need additional help from us? If so, I suggest you share the ICS file.
    Dasong Gao
    @Xanthorapedia
    @ctrueden @hinerm Sure, you may download the file from here. As for ICSFormat, do you think we should use history extents and parameter scale interchangeably?
    Mark Hiner
    @hinerm
    @Xanthorapedia I think we can do what Bio-Formats does and use history extents as the fallback if parameter scale isn't present, or is set to the default 1 x 1 x 1
    Dasong Gao
    @Xanthorapedia
    @hinerm That will do. But what about units? This ICS uses scale 1 and unit undefined for each axis and puts calibration in history extents, which has no units attached. BioFormats and the current SCIFIO assumes the default units (seconds, um, etc.) in this case.
    Dasong Gao
    @Xanthorapedia
    One hierarchy I can think of is:
    • parameter scale with parameter units
      If (parameter scale is missing or parameter units is undefined or missing) and history extents is present:
    • history extents with default units
      If nothing works:
    • Default values with default units
    Better suggestions?
    Curtis Rueden
    @ctrueden
    @hinerm I went ahead and reviewed + merged #428. The mega melt is likely to identify any downstream issues with it, but I expect nothing bad will happen. (Obligatory parenthetical note about how now something bad will happen because I said that, but because I include this fourth-wall-breaking note maybe we'll be spared the wrath of the irony gods after all.)
    Mark Hiner
    @hinerm
    :+1:
    Jan Eglinger
    @imagejan
    Are there any plans to resurrect the String and File-based methods in FilePatternService that were present in 0.37.3 but got lost when SCIFIO was changing to DataHandle with https://github.com/scifio/scifio/commit/5c11f00f519fd73ea09be6724e8543a73028d745#diff-09fdb44bddc5a27ef1f3c369ea067e9d ?
    Curtis Rueden
    @ctrueden
    @imagejan Wasn't planning on it, but we probably should, eh?
    Deborah Schmidt
    @frauzufall
    @imagejan I can do that.
    Jan Eglinger
    @imagejan
    @ctrueden @frauzufall just asking because I started using FilePatternService only now, but saw that it’s typed on DataHandle while Fiji still ships the old version. I can live with switching to DataHandle, I just need to know : )
    Curtis Rueden
    @ctrueden
    I have no strong preference!
    Hopefully we'll be out of our limbo state within another 1-2 weeks. I'm technically on vacation now, so no progress from me for the next few days.
    Deborah Schmidt
    @frauzufall
    I'll just readd the methods which were removed. Let me know if you can think of more places like this @imagejan :)
    Jan Eglinger
    @imagejan
    :+1: we could also run revapi on this to get a comprehensive list, no?
    Deborah Schmidt
    @frauzufall
    yes, I used that for specific classes like IO in the past to fix these issues, running it on the whole scifio package resulted in an endless list. But I can try again, maybe with regex to check for services
    Jan Eglinger
    @imagejan
    Ah, alright. I have no strong opinion about keeping these, really. We’re at version 0.x.x after all :-D
    Deborah Schmidt
    @frauzufall
    if we want to keep things simple to use e.g. from scripts, having String or File parameters in service methods instead of / additionally to Location or DataHandlemakes sense.
    Deborah Schmidt
    @frauzufall
    Hi all, I'm looking at making the imagej-server code compatible to pom-scijava 29 and need some advice. It's e.g. calling locationService.mapFilehere from io.scif.services.LocationService which does not exist any more. It maps files to e.g. ByteArrayHandle, another gone class. There does not seem to be a similar feature available in org.scijava.io.location.LocationService so I was wondering where that went / how it could be addressed.
    Jan Eglinger
    @imagejan
    maybe BytesHandle and DataHandleService help here??
    Deborah Schmidt
    @frauzufall
    thanks @imagejan, that helps! I'm still looking for the String <-> Buffer mapping functionality replacement of the old LocationService.
    Curtis Rueden
    @ctrueden
    @frauzufall The LocationService knows how to resolve strings to Location objects using LocationResolver plugins. The DataHandleService knows how to wrap Location objects in DataHandles. (In case it wasn't already clear: a location is just an indicator of data source/destination, whereas a data handle knows how to do random/direct access byte extraction from a location.)
    There is no mapping functionality anymore; it's not necessary.
    You just make the Location you want, and then open it (for reading or writing) with the DataHandleService.
    For byte arrays, create a BytesLocation. No need for mapFile or mapId or any of that hacky stuff.
    Deborah Schmidt
    @frauzufall
    Thanks @ctrueden, I'll give it a try
    Jan Eglinger
    @imagejan
    @frauzufall @ctrueden it seems the new scifio served by the latest update is lacking the FormatService.getFormat(String) method in favor of the DataHandle-based methods. I didn't notice so far, but have a script using that method. I can update my script of course, but I guess we should also bring back that method signature (deprecated) for backwards compatibility, no?
    Deborah Schmidt
    @frauzufall
    Agreed. I wanted to also make the FilePatternService backwards compatible, but I didn't do it :(
    Jan Eglinger
    @imagejan
    I can also look at it when I find the time later this week.
    Jon Fuller
    @jfkotw
    Hi there. I'm trying to write a unit test to help get to the bottom of: scifio/scifio#399
    I can reproduce the originally described issue using a publicly available 3.5Mb image. I can also show the 'hanging' issue that Manuel describes at the bottom of the ticket (when using scifio 0.4.0 or 0.4.1). I spent a bit of time trying to use the image generation (fake) images to reproduce the issue, but I'm not familiar with the API yet, so got a bit stuck. So... would it be OK to submit a unit test using the 'real' image, or could someone point me to some documentation or an example for creating a composite channel example image?
    Curtis Rueden
    @ctrueden
    @jfkotw Any test is better than no test. :-)
    If you make a working illustration, we can look into: A) changing it to use a testimg instead if possible; and failing that B) if Manuel is OK with releasing the image into the public domain, adding it to the https://scif.io/images collection, which we use for unit tests already.
    The unit tests download and cache the images locally, so that it's only slow to run them the first time.
    Jon Fuller
    @jfkotw
    Fantastic. Thanks for the quick response. The image in question is already published here under Creative Commons Attribution 4.0 International License, so I guess it is easily possible to add that the scif.io/images (is that something I can do myself?)
    I will prepare a PR with the unit test today.
    Curtis Rueden
    @ctrueden
    @jfkotw You can do most of it yourself: edits need to happen to this index.html file including adding an appropriately sized thumbnail to that images folder. The data itself is served from samples.scif.io which is not hosted on GitHub Pages, because some of the samples are too large for GitHub. I can put the image in place in response to your PR. Coincidentally, I'm working on the SCIFIO samples page today anyway, adding some FLIM image data. I will also look into adding a "License" column to clarify the license of each image, since it will no longer be CC0/PD for everything anymore.
    Jon Fuller
    @jfkotw
    Thanks Curtis. Two PRs now created. New to this, so just let me know if you need any changes or additional information.
    Curtis Rueden
    @ctrueden
    @jfkotw The update to the SCIFIO sample images is merged. I'll work on the other PR tomorrow. Thanks for your patience.
    Deborah Schmidt
    @frauzufall
    Still trying to fix imagej-server - with the new Location API, how does one handle an InputStream? I can't figure out a way to wrap it with a Location, which I would need to call datasetIOService.open(..). Differently formulated - how to use SCIFIO to open an image from an InputStream?