How to fill irregular region in 3D then go back to stacks

I’d like to be able to fill in or crop irregular selections on a 3D stack of images. For example, in the fluorescent max projection below, I’d like to get rid of the part of the signal that I note with arrows. This signal is coming from tissue that is in the same plane as the desired signal but it’s labeling an unwanted structure. I’ve uploaded an example stack to dropbox too.

So far, I’ve dealt with this issue in two ways:

  1. Scroll through the stack, draw selections around the unwanted signal, and push the delete key. This is effective but tedious.

  2. I can open the stacks in 3D viewer, rotate the image so that I’m looking top/down, draw a selection around the unwanted signal then fill it. This is efficient but I’m not sure how to revert the edited image back to 2D stacks.

I know there are tools like 3D crop, but it seems like the unwanted signal must fit within a rectangular region. Unfortunately due to the nature of my tissue, each slice within a stack contains wanted and unwanted signal making this approach unfeasible.

max proj.tif (513.7 KB)

Thank you!


if you are trying to remove filament-like structures like in the example you uploaded you could use the simple neurite tracer (subsribe to the Neuroanatomy update site) to create a mask of the structure that you want to remove.
Open the SNT and trace the filament . Then fill it with > Show Fill Manager > Define a threshold > Export > Image Stacks.

You can now use this mask to filter the image by for example inverting it (Edit>Invert), and then using image calculator to mask the non-zero region: Process >Image Calculator>Multiply
The max projection then looks e.g. like this:

Note that you are actually modifying your image and cannot call it a “raw image” any more. Whether removing the structure is appropriate at all really depends on your research question and desired analysis (i.e. not appropriate when showing a “representative image”, but appropriate when using it as preprocessing for e.g. further quantification )

As an alternative for selecting more complex structures you can look at ROI interpolation: open ROI Manager > [create a few rois in different slices] > click on ‘More’ > Interpolate ROIs

Sorry I’m a low on time for a full answer.

How to voxelize a .STL file might help

We are also releasing a cropping tool for arbitrary meshes in SciView in the near future. The prototype already exists.

1 Like

Thanks for your reply. I think SNT will be really helpful for removing the nerve in the back. I actually normally have a much more complicated situation, such as the max projection below. I’m labeling both sides of a pectoral fin with magenta, while the front side only is also labeled with green. In addition to removing that straight nerve in the back, I’d like to be able to separate the two sides of the fin to analyze them separately. As the tissue doesn’t lay flat, each slice in the stack has a little bit of the front innervation layer (green and magenta) and a little bit of the back innervation layer (magenta only). Also, as these are transgenic fish I don’t always have the dual colors available and sometimes only have the one color that labels both sides.

2 color.tif (1.0 MB)

I’ve tried using SNT and neuronJ to trace the innervation pattern but given its complexity even these semi-automated approaches take longer than just scrolling through and deleting the unwanted signal.

I’m sorry for not uploading the double-colored picture in the first place, but would definitely appreciate any and all suggestions. Thanks!

Stack here:

At least for the two-colored case, could you not just create a mask based on (thresholding of) the green channel, and then select everything inside the mask to obtain the front layer, resp, everything outside the mask (invert the mask) to obtain the back layer?