ITK Vessels segmentation code

(Pooja Virkar) #1

Hello,

  1. I am trying to run Vessels segmentation program from

https://itk.org/ITKExamples/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/Documentation.html

But I am getting following error -
fatal error: itkMultiScaleHessianBasedMeasureImageFilter.h: No such file or directory

Also I am unable to understand that in this program, for Input what should I give 2D image/slice or 3D volume /series?
And how to choose the sigma values?

  1. Also I tried the program from

https://itk.org/ITKExamples/src/Filtering/ImageFeature/SegmentBloodVessels/Documentation.html

But still not getting an error -
error:
itk::ExceptionObject (0x1682ae0)
Location: “void itk::RecursiveSeparableImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData() [with TInputImage = itk::Image<float, 3>; TOutputImage = itk::Image<float, 3>]”
File: /usr/local/include/ITK-4.13/itkRecursiveSeparableImageFilter.hxx
Line: 245
Description: itk::ERROR: RecursiveGaussianImageFilter(0x164fc50): The number of pixels along direction 2 is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.

In this program dimension is 3. So should I give series as input? And how to select sigma and alpha values for vessels segmentation?

Please help me to solve this error.

(Dženan Zukić) #2

The first example uses 2D images as input, the second one uses 3D images.

As answered on stack overflow, you need to set CMake variable Module_ITKReview to ON when configuring ITK.

You should change Dimension to be 2 if you are working with 2D images. 2D images have 1 pixel along third axis.

As to choosing proper sigma values, they should be close in size to the vessels present in the image. But you will have to experiment with different sizes to find the appropriate one for your task.

(Pooja Virkar) #3

Thank you for the help.
Its working.

But I have one more doubt.
For following program -

https://itk.org/ITKExamples/src/Filtering/ImageFeature/SegmentBloodVessels/Documentation.html
strong text
If I changed the dimension = 2 in program, then I am getting following error. (attached in pdf)print.pdf (18.5 KB)
print1.pdf (16.9 KB)

How to solve it? & What changes should I do in program for dimension =2 ?

And also if I want to keep the dimension = 3, then it means i should provide 3D data ie. complete series of slices. Is it correct?
And for header file “itkImageSeriesReader” should include in program. It will work then?

(Dženan Zukić) #4

The filter Hessian3DToVesselnessMeasureImageFilter is working only with 3D images, as its name implies. I guess the first example can be adjusted to work with different image dimensions, whereas the second one only works with 3D images.

That is correct. And you could use itkImageSeriesReader, or convert your series to a single-file 3D image (.mha, .nrrd etc) using e.g. Slicer.

(Pooja Virkar) #5

Hello,
I tried this Hessian3DToVesselnessMeasureImageFilter with my dicom series. But I am getting following error.

Error: In /home/PVirkar/bin/ITK/InsightToolkit-4.13.2/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx, line 649, function bool gdcm::PixmapWriter::PrepareWrite(const gdcm::MediaStorage&)
Problem with NumberOfDimensions and MediaStorage

Error:
itk::ExceptionObject (0x238bab0)
Location: “virtual void itk::GDCMImageIO::Write(const void*)”
File: /home/PVirkar/bin/ITK/InsightToolkit-4.13.2/Modules/IO/GDCM/src/itkGDCMImageIO.cxx
Line: 1232
Description: itk::ERROR: GDCMImageIO(0x2342980): DICOM does not support this component type

I used signed short and unsigned int as pixel types (because it supports Dicom series) and dimension = 3.
But still I don’t understand why error showing “DICOM does not support this component type”

Also I would like to get a single dicom file as output, ie i am using itkImageFileWriter.

(Dženan Zukić) #6

Not all combinations of pixel types etc are valid for DICOM. Try writing into a different format, e.g. .mha or .nrrd. If that succeeds, you can then try to figure out what is the problem with DICOM.