Removing background of CT scan 3D images


#1

Hello all. I’m an absolute beginner with ImageJ/Fiji. I’ve been able to apply a few useful built-in tools to my CT scans, but many of the filters fail or get thrown off because my images have a background (that clearly contains no information). The kind of images I look at can be found here: https://blog.highmarkhealth.org/low-dose-ct-scans-show-promise-in-detecting-early-stage-lung-cancer/lungcancer. As you can see, anything outside the inscribed circle is useless background.

My question to the community is: How do you suggest I get rid of this background? Can I do this using the existing functions, or do I have to write my own script or plug-in? (additional detail that may be of help: for my purposes, it would be OK to merge the background with the dark, textured parts at the top and bottom of the disk.) One idea, suggested by a community member, would be to generate a circular ROI covering the area of interest and nothing else, and then do the filtering on that. But the ROI would be specific to (and thus would have to be generated automatically for) each scan, and even each slide of the 3D scan. Any suggestion on how to do that? Thanks a lot in advance! -JF


#2

Good day!

I’m not perfetly sure but it should be possible to get the images without the legends from your CT-imaging apparatus, or do you use images from the literature which I don’t recommend for several reasons. You are linking to a JPG-compressed image that as such should not be used for scientific image analyses.

If your images are all of the same format as the sample image, you could use the following simple ImageJ-macro:

run("Specify...", "width=946 height=946 x=506 y=473 oval constrain centered");
setBackgroundColor(0, 0, 0);
run("Clear Outside");
run("Crop");
run("Select None");

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it.

But again:
Don’t use images that are JPG-compressed, because this compression is not lossless and introduces image artifacts!

Regards

Herbie


#3

Thanks Herbie! I’ll try that. And no, I am not using compressed / lossy images found in the literature.
When you say “legend”, are there typically meta-data included in CT scans that may contain background information?
Best regards,
JF


#4

Good day,

the sample image from your link shows text-metadata in all four image corners and a scale bar on the mid-right side.

From what you write I conclude that you want to eliminate the metadata from the image corners etc. I think that this can be done with the CT image processor. There should be an option to output images without the imprinted metadata.

Furthermore I’m sure that CT-images have at least 12bit depth but the sample image is 8bit JPG-compressed.

In any case don’t use JPG-compressed images.

Here is a macro code that is a bit more flexible regarding the image format:

b = 12;
sz = getWidth();
if ( sz < getHeight() ) sz = getHeight() + b;
run( "Canvas Size...", "width="+sz+" height="+sz+" position=Center zero" );
doWand( b, 0.5*sz-b );
run( "Fit Circle" );
setBackgroundColor( 0, 0, 0 );
run( "Clear Outside" );
run( "Crop" );
run( "Select None" );
exit();

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it.

HTH

Herbie


#5

Hi Herbie (and all)
Apologies for the late reply and many thanks for the tip.
JF