[Insight-users] using NeighborhoodConnectedImageFilter

Xabier Artaechevarria Artieda xabiarta at unav.es
Wed Oct 11 03:20:22 EDT 2006


Hi Ravi,
you are setting the radius to (2,2,0). Should not it be (2,2,1)?
I hope that this helps.
Regards,
Xabi

-- 
Xabier Artaechevarria
Cancer Imaging Laboratory
Centre for Applied Medical Research
www.cima.es



Ravinder Singh <rschauhan18 at yahoo.com> ha escrito:

> Hi,
>
>   I am trying to remove the background of the 3D volume using   
> NeighborhoodConnectedImageFilter. Here is what I am doing.
>
>   I read the series of files by using ImageSeriesReader and write   
> the files using Imageserieswirter. In between these, I am rescaling,  
>  binary thresholding and inverting the images. then I tried to use   
> neighborhoodConnectedImage filter as follows:
>
>
>     
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>   typedef signed short InputPixelType;
>   const unsigned int Dimension = 3;
>   typedef itk::Image< InputPixelType, Dimension > ImageType;
>
>   typedef itk::NeighborhoodConnectedImageFilter< ImageType,   
> ImageType > ConnectedFilterType;
>   ConnectedFilterType::Pointer neighborhoodConnected =   
> ConnectedFilterType::New();
>
>   neighborhoodConnected->SetInput( *inputImage );
>   neighborhoodConnected->SetLower( 255 ); /*since the image is   
> binary, I want to extract the white part */
>   neighborhoodConnected->SetUpper( 255 );
>   ImageType::SizeType radius;
>
>   radius[0] = 2; // two pixels along X
>   radius[1] = 2; // two pixels along Y
>   radius[2] = 0;
>
>   neighborhoodConnected->SetRadius( radius );
>   ImageType::IndexType index;
>
>   index[0] = value[0];
>   index[1] = value[1];
>   index[2] = value[2];
>
>   neighborhoodConnected->SetSeed( index );
>   neighborhoodConnected->SetReplaceValue( 0 );
>   neighborhoodConnected->Update();
>   (*outputImage) = neighborhoodConnected->GetOutput();
>     
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>   This piece of code is not working. Any suggestions.
>   Thanks a lot.
>   Ravi
>
>
> ---------------------------------
> How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.



----------------------------------------------------------------
Este mensaje ha sido enviado desde https://webmail.unav.es



More information about the Insight-users mailing list