[Insight-users] using NeighborhoodConnectedImageFilter

Ravinder Singh rschauhan18 at yahoo.com
Wed Oct 11 17:19:57 EDT 2006


Hi Xabi,
  Thanks for the reply. 
  My understanding is the 0 is for 0 slice as the slice number starts from 0. Well I got its solved, I am a fool....was giving wrong seed point.
   
  I have one more question:
  In neighborhoodConnectedThresholdFilter, It fills the region which is outside the two threshold values with zero pixels by default. Is there a way to change this to a value specified by user, similar to the value specified for the region included within two threshold values.
   
  Regards
  Ravi

Xabier Artaechevarria Artieda <xabiarta at unav.es> wrote:
  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 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



 		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20061011/264e6a3c/attachment.html


More information about the Insight-users mailing list