How to create MIP images from the command line?

Hello Dear Developers and Users

Can the MIP viewer module be run from the command line?
In other words, how can I generate axial MIP images from the command line by setting Slice Size MIP in any way possible?

Please guide me.
Thanks a lot.
Shahrokh.

Hello @shahrokh

One option is to write a python script to generate the MIP and write out the resliced image output to a file.

https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Thick_slab_reconstruction_and_maximum.2Fminimum_intensity_volume_projections

You can then run your python script using --python-script command line option in Slicer.

-Andinet

1 Like

Hello Andinet

Thank you very much for your guidance. I have some questions about the concept of MIP that I hope you will guide me, perhaps I should not ask my question in here.

Thanks a lot for your help. To create the MIP images, I used the Python code provided on github:
Title: GitHub - ljpadam/maximum_intensity_projection: Maximum intensity projection for medical image
Address: https://github.com/ljpadam/maximum_intensity_projection

I think that the slices_num parameter in the maximum_intensity_projection.py code (in the above link) is similar to the Slice size MIP in the module of MIP Viewer. Is it true?

As you can see in the following image, if I increase slices_num in the code of maximum_intensity_projection.py or Slice Size MIP in 3DSlicer, more arteries will be projected in the axial slice.

This destroys the vascular view in the coronal slice as you can see in the following image:

Is this situation unavoidable in a MIP view?

How can I have good quality of MIPs in the three directions (AP, IS and LR)?

Please guide me.
Thanks a lot.
Shahrokh.

This code, as is, does not make a lot of sense, as it does thick slice reformat for every slice of a volume. However, you could easily change it to compute the maximum intensity for all slices and along any of the 3 images axes.

If you need arbitrarily oriented views then I would recommend to use the script that @Andinet_Enquobahrie linked above. If you need perspective projection (to simulate fluoroscopy images) or you need fast MIP generation (50-100 images per second) and 8 bit precision is enough then you can use the volume renderer.