Cropping unwanted object from 512 CT/DICOM slides of Mice for Registration

Hello, I need to crop out this banana-shaped object (the support) from 512x512 CT mice slides. Is there a way to do this to all 512 slides without alternating the dimensions? Thank you.
For example this is what the first slide looks like:

Hi @ihidro1

Welcome to the Forum!

So… why exactly do you need to crop out this object? Are you carrying out other analyses on the image after this ‘crop’? What are they exactly - what do you need to measure?

Just to make sure that the cropping doesn’t influence your later steps…

To get you started - you can take a look at this ImageJ1 macro I just made that essentially will clear those pixels within that ‘banana’ object:

id = getTitle();
run("Duplicate...", " ");

setAutoThreshold("Default dark");
run("Create Mask");
run("Fill Holes");
run("Analyze Particles...", "  circularity=0.00-0.5 add");
roiManager("Show None");
roiManager("Show All");
roiManager("Select", 0);
run("Clear", "slice");

This is by-no-means a final solution and should be adapted/improved… it’s just to get you started. Perhaps others on the Forum will have better, more concrete options for you - especially after you provide a bit more information from my questions above.


eta :slight_smile:

Hey @etadobson we are are trying to register these stacks across different time points, and we want to take out the support (banana) for all 512 slides because we do not want our registration software to take it into account. Will the macro you created clear the object for all 512 slides? Thanks for your help.

So @ihidro1

If your goal is to do registration… then I’d think that the support would be very helpful to use to as an ‘anchor’ for the registration. I would advise against deleting/cropping it out - this information could be incredibly helpful … but again - it depends on exactly what you need/want to do with these images. Perhaps you provide more details? How will you register your images? What analysis do you need to do afterwards? etc.

Perhaps those on the Forum that are more adept at registration can better assist you.

As for your final question - this macro would have to be adapted - I only quickly put it together on the single image you posted so you can at least see the general steps. You can look at the ImageJ1 Built-In Macro functions here and read up more on ImageJ1 Macro language here.

Hope this helps a bit!