Skip to content

Conversation

@cgoina
Copy link

@cgoina cgoina commented Jun 26, 2025

@StephanPreibisch Changes to be able to read and process 5D OME-ZARR inputs.

  • RS-FISH only supports 3-D images so I had to somehow get the corresponding 3-D hyperslice for each channel and timepoint from the OME-ZARR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated spark and some packages as they were in BigStitcher-Spark and replaced the assembly plugin with the shade plugin. With the assembly plugin the full jar didn't work properly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cgoina, I do not think changes to this class are necessary. We simply need to use Views.hyperslice() in the SparkRSFISH class ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it like that initially but IMO these made the code in SparkRSFISH cleaner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

What I do not like is that statements like if ( d < 3 ) and return min.length > 3 ? Arrays.copyOf(min, 3) : min; do some "magic" depending on the input and are very fragile. What happens when I select a block size in c & t > 1?

I would like to keep it the way it is because a Block is a unit that computation is done on, which is either 2D or 3D.

final JavaSparkContext sc = new JavaSparkContext( sparkConf );

// only 2 pixel overlap necessary to find local max/min to start - we then anyways load the full underlying image for each block
final ArrayList< Block > blocks = Block.splitIntoBlocks( interval, blockSize );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgoina I would simply add a loop over the dimensions >= 3 here (c,t), i.e. creating blocks for each c,t ... after using Views.hyperslice(img,c,t)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the correct way is to parse the OME attributes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephanPreibisch and @krokicki I added support for reading attributes from OME-ZARR metadata and reverted all changes from aws subpackage - I think that can be deleted now because I N5Utils should handle the URI but I have not tested it with AWS or GC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

What I do not like is that statements like if ( d < 3 ) and return min.length > 3 ? Arrays.copyOf(min, 3) : min; do some "magic" depending on the input and are very fragile. What happens when I select a block size in c & t > 1?

I would like to keep it the way it is because a Block is a unit that computation is done on, which is either 2D or 3D.


public class SparkRSFISH implements Callable<Void>
{
public enum StorageType { N5, ZARR, HDF5 }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n5-universe already has a type for this so I am using that

private int maxChannel = -1;

@Option(names = {"--excluded-channels"}, split = ",", description = "Comma-separated list of (0-based) channel values")
private Set<Integer> excludedChannels;
Copy link
Author

@cgoina cgoina Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this option can help us with out EASI-FISH pipeline to exclude the DAPI channel from spot extraction. Before it was not an issue because the channels were subsets but now it could be helpful since channels are a dimension in the nd-array. Timepoints not an issue yet because so far we only have one timepoint

@krokicki
Copy link

krokicki commented Sep 6, 2025

Note that @mzouink already added intensityMethod here:
#4

I'm not sure why that PR was never merged.

@mzouink
Copy link
Member

mzouink commented Sep 6, 2025

@krokicki It has never been merged. I cleaned/updated the branch. and i think it is ready to be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants