[Insight-users] ConnectedThreshold and strange behavior when changing ReplaceValue

Luis Ibanez luis.ibanez at kitware.com
Mon, 19 Apr 2004 09:57:28 -0400


Hi Yasser,

You intuition is right,

The value of SetReplaceValue() shouldn't change
the shape of the resulting segmented region.

Could you please post a minimal (working) piece
of code where you are observing this behavior.

If this happens only with a particular image,
please post the image too, and the parameters
for which this behavior is appearing.


Just out of curiosity,... have you verified that
this is not due to the post-processing of the
segmented region   ?
(e.g.... visualization settings )


Please let us know,

Thanks


    Luis


----------------------
yasser salman wrote:

> Hi All..,
> i'm using itkConnectedThresholdImageFilter to segment
> a region in 3D , it works good , but when i change the
> Value in SetReplaceValue() The *Shape* of the
> segmented Region Changed.., i read that this function
> used  to  replace thresholded pixels. Pixels that lie
> * within Lower and Upper  will be replaced with this
> value. so why the shape
>  changed ? i expect changes in Contrast or
> brightness.., can any Body Help me to understand this?
> thanx .., 
> yasser ..,
>     
> 
> connectedThreshold->SetInput( smoothing->GetOutput()
> );
>   connectedThreshold->SetLower(  L_threshold  );
>   connectedThreshold->SetUpper(  H_threshold);
>   connectedThreshold->SetReplaceValue(
> SegmentedRegionColor );
> 
> 
>   typedef ConnectedFilterType::IndexType IndexType;
>   IndexType seed;
>   seed[0] = axi;
>   seed[1] = cron;
>   seed[2] = sag;
> 
>   connectedThreshold->SetSeed( seed );
>  
> connectedThreshold->Update();
>  ITK2VTKconnector->SetInput(connectedThreshold
> ->GetOutput());
>  
> ITK2VTKconnector->GetImporter()->SetDataScalarTypeToUnsignedChar();
> //
> .... To vtk pipeline.....
> //...
> 
>