fiji / SPIM_Registration

Deprecated, instead check out: https://github.com/preibischLab/multiview-reconstruction & https://github.com/PreibischLab/BigStitcher
GNU General Public License v2.0
23 stars 22 forks source link

Use ChannelSeparator.setSeries() #84

Closed hkmoon closed 7 years ago

hkmoon commented 9 years ago

for loading the specific angle image in the context of LOCI image loader. Otherwise, OME.Tiff always gives the first angle image. Pavel asked me to investigate it in the last week. It turned out that we need to use the setSeries() for specifying the actual series by finding the actual series index with the filename.

StephanPreibisch commented 9 years ago

Hi @hkmoon,

I do not understand what exactly is done there, can you explain it in detail?

Thanks so much, Stephan

hkmoon commented 9 years ago

Hi @StephanPreibisch,

No problem. Actually, the OME.Loci.Tiff opener needs to call setSeries() for picking the right file up from where the folder contains multiple files. For example, if I have those files in a folder and try to load spim_TL01_Angle5.ome.tiff, it will fail to open it. Because, the OME.Loci opener always returns the first file unless we specify the series index. 10-views_ome

You probably see the below panel whenever you drag one of the listed files. The default series index is the first even if you drag the other tiff file.

bio-formats_series_options_and__fiji_is_just__imagej

So, we need to specify series index in order to load the other images rather than the first file. Only Big Tiff images are affected. If you want, I can give you these files to be tested.

StephanPreibisch commented 9 years ago

Thanks @hkmoon! However, this part was more or less clear to me. But what I do not understand is based on what you decide to set the series_id, seems like the filename the ImgLoader gets. More specifically, I am not sure if this is just something that works for this specific dataset, but will crash on a set consisting of independent files, or one where a single file has multiple series_ids, you know what I mean?

hkmoon commented 9 years ago

@StephanPreibisch That is right. I think we need more datasets in order to verify that this approach would work. However, there must be more professional people than me regarding OME Tiff context. I would like to ask @dscho, @ctrueden, @hinerm if my approach is reasonable or not, for StackImgLoaderLOCI only if they have some moments to have a look on it. Please, give us your feedback. Thank you so much.

StephanPreibisch commented 9 years ago

Hi @hkmoon, I have written an ImgLoader for the Lightsheet Z1 data that does take into account the series_id's. I am pretty sure I know how to do it, I just thought you looked it up and I did not understand it right. You can make all this testdata yourself by just saving it from Fiji as TIFF (i.e. a dataset that includes multiple channels in one file and multiple timepoints in file, compared to one that spans over multiple files and the one you have already). You can query files that are involved in one dataset, and depending on that set the right series. It is just a little more complicated compared to what you already started. Let me know if you need more support on how to proceed.

Cheers, Stephan

hkmoon commented 9 years ago

Hi @StephanPreibisch,

I just vaguely assumed that you have done it right except setSeries() call in StackImgLoaderLOCI class. Because you have already treated timpepoints and channels in that code. Additiontionally, I used IFormatReader.getUsedFiles() in order to find the right series index.

I am trying to do my best for testing the other types of datasets. However, I do not have such a broad experience like you in Fiji. I will might ask your help little bit more.

In addition to my test dataset, we need to test:

Am I right?

Cheers, HongKee

ctrueden commented 9 years ago

@hkmoon Unfortunately, I think your strategy of parsing the series index out of the filename will fall down in many cases, as @StephanPreibisch suggests.

In Bio-Formats terms, a single "image series" is a 5D block of pixels in XYZCT. There can be multiple series in an initialized dataset, each of which may differ in its characteristics (dimensional sizes, pixel type, etc.). But Bio-Formats provides no guidance regarding what those multiple series mean.

You can assume they represent multiple angles of a SPIM dataset, but that might not always be the case, unless the OME-TIFF file has extra metadata defining that somehow. (This type of metadata is what the OME team refers to as "Image-Image links", and has been on the "to-do" list for several years.)

For now, the easiest thing to do may be to call r.getSeriesCount() to learn the number of series, and just assume there are that many angles in the dataset, and index them that way.

/cc @melissalinkert

hkmoon commented 9 years ago

Thank you so much @StephanPreibisch, @ctrueden!! I am still feeling like walking in the darkness. But, @StephanPreibisch's LightSheetZ1ImgLoader uses setSeries() already. Multiple time points with two angles dataset can be loaded well with that code. The next test set will be a multi-channel dataset.

hkmoon commented 9 years ago

Hi @StephanPreibisch ,

Now the code supports multi-channel. Do you think that multi-illumination should be supported? How can I add illuminations to the multi-angle, multi-timeseries, multi-stack, multi-channel? If you have any example to create multi-illuminations with multi-channel, could you let me know?

Cheers, HongKee

hkmoon commented 9 years ago

Let's assume all the timeseries index should start from 0. https://github.com/openspim/SPIMAcquisition/commit/15b88e30a19c62acfb63b3f983ca41daa04f7b44

ctrueden commented 7 years ago

@StephanPreibisch This is a very old PR now. Should we try to get it merged? Or close it?

hkmoon commented 7 years ago

I close this PR as it is really old now. Hopefully, the issue has been fixed already.