[Insight-users] multi-input filters unwilling to work

Dan Mueller dan.muel at gmail.com
Thu Aug 27 10:07:40 EDT 2009


Hi Michael,

Nothing is jumping out at me. Have you verified that the output of the
DicomReader is a proper image (ie. not black)? Perhaps post the code
that gets the image from the DicomReader. It might be useful to create
a minimal console example that anyone on the mailing list can compile
and run (CMake + source). The easier you make to reproduce an issue,
the more likely you are to get a response. Looking at code only gets
you so far...

Regards, Dan

2009/8/27 Michael Xanadu <xanadu.michael at googlemail.com>:
> Hi Dan,
>
> thanx for your support. Here's the code. There are accordant images (for
> each step in the pipeline) in the attachment.
> Please take a look. Michael.
>
>
> /////////////////////////////////////////////////////////////////////////
>
> const double initialDistance = 5.0;
> const double sigma =  1.0;
> const double alpha =  -0.3;
> const double beta  =  2.0;
> const double curvatureScaling   = 0.05;
> const double propagationScaling = 1.0;
>
> typedef itk::Image< float,3 > InternalImageType;
> typedef itk::Image< short,3 > ShortImageType;
>
> typedef itk::CurvatureAnisotropicDiffusionImageFilter <ShortImageType,
> InternalImageType> SmoothingFilterType;
> typedef itk::GradientMagnitudeRecursiveGaussianImageFilter
> <InternalImageType, InternalImageType> GradientFilterType;
> typedef itk::SigmoidImageFilter <InternalImageType, InternalImageType>
> SigmoidFilterType;
> typedef itk::FastMarchingImageFilter <InternalImageType, InternalImageType>
> FastMarchingFilterType;
> typedef itk::ShapeDetectionLevelSetImageFilter <InternalImageType,
> InternalImageType> ShapeDetectionFilterType;
> typedef itk::BinaryThresholdImageFilter <InternalImageType,
> InternalImageType> ThresholdingFilterType;
>
> ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();
> SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();
> GradientFilterType::Pointer gradientMagnitude = GradientFilterType::New();
> SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();
> FastMarchingFilterType::Pointer fastMarching =
> FastMarchingFilterType::New();
> ShapeDetectionFilterType::Pointer shapeDetection =
> ShapeDetectionFilterType::New();
>
> // the input comes from a dicomreader
> smoothing->SetInput( m_Dicomreader->GetITKOutput() );
> gradientMagnitude->SetInput( smoothing->GetOutput() );
> sigmoid->SetInput( gradientMagnitude->GetOutput() );
> shapeDetection->SetInput( fastMarching->GetOutput() );
> shapeDetection->SetFeatureImage( sigmoid->GetOutput() );
> thresholder->SetInput( shapeDetection->GetOutput() );
>
> smoothing->SetTimeStep(0.0625);
> smoothing->SetNumberOfIterations(5);
> smoothing->SetConductanceParameter(9.0);
>
> gradientMagnitude->SetSigma(sigma);
>
> sigmoid->SetOutputMinimum(0.0);
> sigmoid->SetOutputMaximum(1.0);
> sigmoid->SetAlpha(alpha);
> sigmoid->SetBeta(beta);
>
> typedef FastMarchingFilterType::NodeContainer NodeContainer;
> typedef FastMarchingFilterType::NodeType NodeType;
> NodeContainer::Pointer seeds = NodeContainer::New();
>
> InternalImageType::IndexType  seedPosition;
>
> seedPosition[0] = 250;
> seedPosition[1] = 300;
> seedPosition[2] = 0;
>
> NodeType node;
> const double seedValue = - initialDistance;
>
> node.SetValue( seedValue );
> node.SetIndex( seedPosition );
>
> seeds->Initialize();
> seeds->InsertElement( 0, node );
>
> fastMarching->SetTrialPoints(  seeds  );
> fastMarching->SetSpeedConstant( 1.0 );
> fastMarching->SetOutputSize(
> m_Dicomreader->GetITKOutput()->GetBufferedRegion().GetSize() );
>
> shapeDetection->SetPropagationScaling(  propagationScaling );
> shapeDetection->SetCurvatureScaling( curvatureScaling );
> shapeDetection->SetMaximumRMSError( 0.02 );
> shapeDetection->SetNumberOfIterations( 800 );
>
> thresholder->SetLowerThreshold(-1000.0 );
> thresholder->SetUpperThreshold(0.0 );
> thresholder->SetOutsideValue(  0  );
> thresholder->SetInsideValue(  255 );
>
> // here I use a VtkImageViewer2 to show the output
> Utility::popUpImage(thresholder->GetOutput());
>
> ////////////////////////////////////////////////////////////////////////////////////////////////
>
>
>
>
>
> 2009/8/27 Dan Mueller <dan.muel at gmail.com>
>>
>> Hi Michael,
>>
>> I recommended that you post the minimal source code (and possibly
>> data) required to reproduce the issue.
>>
>> Regards, Dan
>>
>> 2009/8/25 Michael Xanadu <xanadu.michael at googlemail.com>:
>> > Hi folks,
>> >
>> > I've got a problem with all segmentation filters which have two inputs,
>> > for
>> > example ShapeDetectionLevelSet or GeodesicActiveContour. I tryed the
>> > accordant examples in the example folders and they work great (with
>> > image
>> > files). But if I replace the input by a dicomreader (of course, I
>> > changed
>> > all accordant parameters, too) I always get a black output with a little
>> > white spot at the coordinate where I placed the seedpoint. I messed
>> > around
>> > with the filter parameters, but I never get a segment, only the spot. Is
>> > somebody familiar with the problem?
>> >
>> > Michael
>> >
>> > P.S.: dicom data = 512 x 512 x 4, short
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.itk.org/mailman/listinfo/insight-users
>> >
>> >
>
>


More information about the Insight-users mailing list