[Insight-users] Error in filter updating.
Luis Ibanez
luis.ibanez at kitware.com
Thu Jul 5 15:02:45 EDT 2007
Hi Francisco,
It is very unusual for an ITK filter to produce an image
output with a NULL buffer.
What leads you to believe that the buffer has a NULL pointer ?
Are you looking at this image with a viewer and finding
that it is (or look) black ?
Are you printing out the values of the Image ?
Are you running this in a Debugger ?
Why are you not printing the exception in the catch statement ?
with your current code, it is likely that the filter is throwing
an exception and you are catching it but not doing anything about
it, not even reporting the fact that the exception is there.
Normally a catch() block should, at least, contain a std::cerr
message such as:
try
{
connectedThreshold->Update();
}
catch( itk::ExceptionObject &exc )
{
std::cerr << exc << std::endl;
}
You shoudl also add a print statement after the catch block,
to help track what may be happening to the filter, something
like
connectedThreshold->GetOutput()->Print( std::cout );
What most likely is happening is that the segmentation parameters
that were applicable to your image of 50 slices are not applicable
to your image of 70 slices. And, that doesn't really have to do
with the 50 or 70 slices, but with the variations in intensity
levels on both images, and the quality of the location given to
the initial seed.
Regards,
Luis
-------------------------------------
Francisco José Cadaval Arrola wrote:
> Hi all. It's my first post. Excuse me for my bad English.
>
> I'm trying to apply segmentation to a 3D Image (of course a set of 2D
> images). In this code smoothing is odf type CurvatureFlowImageFilter and
> connectedThreshold of type ConnectedThresholdImageFilter.
>
> smoothing->SetInput( m_inputImage );
> connectedThreshold->SetInput( smoothing->GetOutput() );
>
> smoothing->SetNumberOfIterations( numberOfIterations );
> smoothing->SetTimeStep( timeStep );
>
> connectedThreshold->SetLower( lowerThreshold );
> connectedThreshold->SetUpper( upperThreshold );
> connectedThreshold->SetReplaceValue( replaceValue );
> connectedThreshold->SetSeed( index );
>
> try
> {
> connectedThreshold->Update();
> }
> catch( itk::ExceptionObject &exc )
> {}
>
> The problem is that when m_inputImage is 512x512x20 (20 images with a
> size of 512x512) the filtering works without any problem but when I try
> to use it with a set of 70 images (for example) the output of
> connectedThreshold has a NULL buffer (while output of smoothing is ok)
> without any exception at updating. The system memory is enough to manage
> this amount of data. I tried to apply just one of the filters and it
> works ok.
>
> Can you help me? Thanks.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list