dgobbi / vtk-dicom

A set of classes for using DICOM in VTK.
BSD 3-Clause "New" or "Revised" License
258 stars 94 forks source link

CT image processing #27

Closed dgobbi closed 9 years ago

dgobbi commented 10 years ago

CT images have two features that can complicate image processing:

  1. only the data within the reconstruction diameter is valid
  2. acquisitions with tilted gantry do not form a rectangular volume

The vtkDICOMReader has recently been modified so that the PatientMatrix has a yz shear if the gantry is tilted. So, it would be good to have a filter that follows the reader than can use this shear to re-grid the image as a rectangular volume. There are actually several things that this post-reader filter can do:

  1. re-grid the image as a rectangular volume
  2. create a new orthogonal PatientMatrix (with shear removed)
  3. create a mask (vtkImageStencilData) to exclude voxels outside of the reconstruction volume
  4. re-color voxels outside the reconstruction volume as "air"

Perhaps the filter could also work in the opposite direction, take a rectangular volume and produce a series of slices that mimic a specific gantry tilt. This would be useful for image registration, when a rectangular volume must be written with the geometry of a gantry-titled volume.

dgobbi commented 9 years ago

The vtkDICOMCTRectifier satisfies most of the points raised in this issue. It regrids the volume, provides a new matrix, and it can work in reverse.

The points that is misses is that it does not create a mask.

SergeiMal commented 2 years ago

Hi @dgobbi Could you please give some advice how to figure out with point "4 - re-color voxels outside the reconstruction volume as "air" "?

dgobbi commented 2 years ago

DICOM sets the stored values of these voxels to PixelPaddingValue.

I've thought of two ways to re-color the padding voxels as air:

  1. set the modality value of the padding voxels to -1000 (which is the value for air, Hounsfield units), or
  2. use the padding voxels to create an alpha mask, so that all padding voxels are transparent and all reconstructed voxels are opaque

The first is probably the easiest to do.

SergeiMal commented 2 years ago

Thank you. I am not so experienced with this area, so I don't think I can realize it myself. Do you have some example how to do it? Or may be some article about this theme. Any information will be useful for me.

Thanks

dgobbi commented 2 years ago

I haven't implemented it, so I don't have an example.

All I have is what you see here. Just an idea.