Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROI Map (too many ROIs selected) #5

Open
StephanTir opened this issue Apr 19, 2021 · 9 comments
Open

ROI Map (too many ROIs selected) #5

StephanTir opened this issue Apr 19, 2021 · 9 comments

Comments

@StephanTir
Copy link

Dear RS-FISH team,

thanks a lot for this great tool! I have an issue that is rather indirectly related to the RS-FISH plugin but which might be of interest for the people who are using it:

I have a relatively large image (9230 x 7688) with ~ 360,000 FISH spots. Spot detection with RS-FISH works nicely but I have a problem with creating a labeled mask from ROIs. I usually use the LOCI "ROI Map" command which works fine for smaller images with less spots, but for the above described case I get the following Error when I try to run "ROI Map" after running RS-FISH:

There are too many ROIs selected

Do you have an alternative or workaround for this problem?

Thanks a lot in advance!

Best

Stephan

Too_many_ROIs

@StephanPreibisch
Copy link
Member

Hi @StephanTir ... first of all thanks! So if I understand this right this is a problem of the ROI manager not scaling to these numbers? Can you at least save the points to disc?

@StephanTir
Copy link
Author

I think so, or at least the LOCI/ROI Map command can't handle the numbers. But I also tried other plugins that can generate a labeled image from ROIs and this also didn't work. For example the BIOP plugin actually generates a labelled image but displays only ~1/6 of all the ROIs.

But yes, saving the ROIs to disk works (although it takes some time) and also reloading of ROIs works.

@Fritze
Copy link

Fritze commented Apr 20, 2021

This is most likely not directly related to RS-FISH but due to the the LOCI/ROI Map command not being able to create images based on more than ~65k ROI's as this is the upper limit of 16bit (probably also the reason why the BIOP plugin creates only 1/6 of all ROIs [60k * 6 = 360k]).

This ImageJ macro (see also this post by @imagejan) should do the same job and create a 32bit image with all spots, each spot with a different intensity value based on its position in the ROI manager:

newImage("Labeling", "32-bit black", getWidth(), getHeight(), 1);

for (index = 0; index < roiManager("count"); index++) {
	roiManager("select", index);
	setColor(index+1);
	fill();
}

@StephanTir
Copy link
Author

That works! Thanks a lot!

@StephanPreibisch
Copy link
Member

Thanks so much @Fritze! @StephanTir can we make this somehow easier for you? What do you ideally want to do after detection?

@StephanTir
Copy link
Author

StephanTir commented Apr 20, 2021

For me the solution that @Fritze suggested is totally fine.

In general, I use RS-FISH for the analysis of multiplexed RNA-FISH (RNAScope) data (12-24 plex).
After spot detection I want to

  1. visualize the overlay of detected spots of a set of marker genes (e.g. in napari). By the way, therefore it would be great if the spot size would be adjustable after detection.
  2. quantify transcripts/spots per nucleus/cell for downstream analysis/clustering. I currently do this in KNIME.

@Fritze
Copy link

Fritze commented Apr 20, 2021

I think for both, visualizing overlays and counting transcripts per nucleus/cell, it would be great to develop a RS-FISH node in KNIME. This would allow users to go from raw images to a transcripts per cell matrix in one reproducible workflow. From what I understand, it should be rather straightforward using the ImageJ2/ImgLib2 integration in KNIME. I am happy to give it a try but I might need a quick intro on how to set up things in maven etc..

@StephanPreibisch
Copy link
Member

The command-line tool (https://github.com/PreibischLab/RS-FISH/blob/master/src/main/java/cmd/RadialSymmetry.java), or Spark command-line tool (https://github.com/PreibischLab/RS-FISH-Spark/blob/main/src/main/java/net/preibisch/rsfish/spark/SparkRSFISH.java) that additionally distributes the task into small blocks, both nicely encapsulate the functionality. Using this it should be trivial to incorporate into a KNIME node. Or @dietzc? :)

@imagejan
Copy link

@Fritze wrote:

it should be rather straightforward using the ImageJ2/ImgLib2 integration in KNIME. I am happy to give it a try but I might need a quick intro on how to set up things in maven etc..

In case it helps, there are many IJ2 plugin examples that auto-generate a KNIME node here:

https://github.com/fmi-faim/fmi-ij2-plugins/tree/master/src/main/java/ch/fmi

You can also start from https://github.com/imagej/example-imagej-command in general. The important thing for node auto-generation in KNIME is that:

  • the plugin is annotated with headless=true, and
  • all annotated inputs are compatible with the KNIME ImageJ2 integration (which is the case for all numeric, string and image input parameters)

If you want to benefit from a KNIME update site with automated deployment already established, I'll be happy to accept pull requests adding new plugins to https://github.com/fmi-faim/fmi-ij2-plugins, otherwise I'm sure @stelfrich, @gab1one and others at KNIME will help you setting up your own update site.

I suggest continuing the discussing at https://forum.image.sc if you want to pursue this route.

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

No branches or pull requests

4 participants