[Insight-users] Can't get itkMultiScaleHessianBasedMeasureImageFilter to work

Manzke, Robert robert.manzke at philips.com
Mon Dec 13 10:13:57 EST 2010


Hi all,

I am trying to get the itkMultiScaleHessianBasedMeasureImageFilter to work on the DSA.png test image. If I process the image using the code below, the result image is pretty much just garbage. Any help is tremendously appreciated!

Thanks,
Rob

// Define the dimension of the images
const unsigned int Dimension = 2;
typedef float                                 InputPixelType;
typedef itk::Image<InputPixelType,Dimension>  InputImageType;

typedef float                                 OutputPixelType;
typedef itk::Image<OutputPixelType,Dimension> OutputImageType;
typedef itk::ImageFileReader<InputImageType>  FileReaderType;
typedef itk::ImageFileWriter<OutputImageType> FileWriterType;
typedef itk::NumericTraits< InputPixelType >::RealType RealPixelType;
typedef itk::SymmetricSecondRankTensor< RealPixelType, Dimension > HessianPixelType;
typedef itk::Image< HessianPixelType, Dimension >                  HessianImageType;

// Declare the type of enhancement filter
typedef itk::HessianToObjectnessMeasureImageFilter< HessianImageType,OutputImageType > ObjectnessFilterType;

// Declare the type of multiscale enhancement filter
typedef itk::MultiScaleHessianBasedMeasureImageFilter< InputImageType,HessianImageType, OutputImageType > MultiScaleEnhancementFilterType;

FileReaderType::Pointer imageReader = FileReaderType::New();
imageReader->SetFileName("c:\\Data\\DSA.png");
imageReader->Update();

ObjectnessFilterType::Pointer objectnessFilter = ObjectnessFilterType::New();
objectnessFilter->SetAlpha(0.5);
objectnessFilter->SetBeta(0.5);
objectnessFilter->SetGamma(5.0);
objectnessFilter->SetObjectDimension( 1 );
objectnessFilter->SetBrightObject( false );
objectnessFilter->SetScaleObjectnessMeasure(false);

MultiScaleEnhancementFilterType::Pointer multiScaleEnhancementFilter = MultiScaleEnhancementFilterType::New();
multiScaleEnhancementFilter->SetInput(imageReader->GetOutput());
multiScaleEnhancementFilter->SetHessianToMeasureFilter( objectnessFilter );
multiScaleEnhancementFilter->SetSigmaStepMethodToLogarithmic();
multiScaleEnhancementFilter->SetSigmaMinimum( 1.0 );
multiScaleEnhancementFilter->SetSigmaMaximum( 10.0 );
multiScaleEnhancementFilter->SetNumberOfSigmaSteps( 10 );
multiScaleEnhancementFilter->SetGenerateScalesOutput( false );
multiScaleEnhancementFilter->Update();

typedef itk::Image<unsigned char, 2> itkUC2ImageType;

typedef itk::RescaleIntensityImageFilter<InputImageType, itkUC2ImageType> itkRescaleIntensityFilterType;
itkRescaleIntensityFilterType::Pointer rescaleFilter = itkRescaleIntensityFilterType::New();

rescaleFilter->SetInput(multiScaleEnhancementFilter->GetOutput());
rescaleFilter->SetOutputMaximum(255);
rescaleFilter->SetOutputMinimum(0);


typedef itk::ImageFileWriter<itkUC2ImageType> itkUC2FileWriterType;
itkUC2FileWriterType::Pointer fileWriter = itkUC2FileWriterType::New();
fileWriter->SetFileName("c:\\Data\\DSA_out.png");
fileWriter->SetInput(rescaleFilter->GetOutput());
fileWriter->Update();

typedef itk::ImageToVTKImageFilter<itkUC2ImageType> itkItkToVtkUC3ImageFilterType;
       itkItkToVtkUC3ImageFilterType::Pointer itk2vtk = itkItkToVtkUC3ImageFilterType::New();
       itk2vtk->SetInput(rescaleFilter->GetOutput());

The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.



More information about the Insight-users mailing list