[Insight-users] Error In segmented region size by using itkRelabelComponentImageFilter.
yasser salman
yass71 at yahoo.com
Wed, 14 Apr 2004 12:28:48 -0700 (PDT)
hi Miller ..,
thanx for ur reply but i'm acutally never use
itkRelabelComponentImageFilter before , so i'm sure
about it's input and output, also how can i get the
size of the segmented region ( or labeled region) by
using this filter
so i try this code , for sure need a modification coz
i had this error message:
" error C2664: 'void __thiscall
itk::ImageToImageFilter<class itk::Image<unsigned
short,3>,class itk::Image<unsigned short,3>
>::SetInput(const class itk::Image<unsigned short,3>
*)' : cannot convert parameter
1 from 'class itk::Image<unsigned short,3> *(unsigned
int)' to 'const class itk::Image<unsigned short,3> *'
Context does not allow for disambiguation of
overloaded function"
typedef unsigned short InputPixelType;
typedef float InternalPixelType;
typedef unsigned short SegmentedPixelType;
typedef itk::Image< InputPixelType, 3 >
InputImageType;
typedef itk::Image< InternalPixelType, 3>
InternalImageType;
typedef itk::Image< SegmentedPixelType, 3 >
SegmentedImageType;
typedef itk::ConnectedThresholdImageFilter<
InternalImageType, SegmentedImageType >
ConnectedFilterType;
typedef itk::ImageToVTKImageFilter<
SegmentedImageType >
ITK2VTKConnectorFilterType;
typedef itk::VTKImageToImageFilter< InputImageType
>
VTK2ITKConnectorFilterType;
typedef
itk::RelabelComponentImageFilter<SegmentedImageType,SegmentedImageType>
RelabelImageFilter;
ReaderType::Pointer reader = ReaderType::New();
rcfilter->SetInput(connectedThreshold->GetOutput);
rcfilter->Update();
ITK2VTKconnector->SetInput(rcfilter ->GetOutput());
ITK2VTKconnector->GetImporter()->SetDataScalarTypeToUnsignedChar();
thanx
yasser s.,
--- "Miller, James V (Research)" <millerjv at crd.ge.com>
wrote:
> You could use the RelabelComponentImageFilter.
> Given a segmented image,
> it relabels it such that label 1 is the largest
> object, label 2 is the next
> largest object, etc. Once the relabeling has been
> performed, you can query
> the size of a labelled object in terms of number of
> pixels or volume.
>
> It is a bit of an overkill for the output of the
> ConnectedThreshold. We
> could add a similar API to the segmentation
> algorithms. By having the
> capability in another filter, we have factored out
> the capability so it can
> used on the output
> of any of the segmentation algorithms.
>
> Jim
>
>
>
> -----Original Message-----
> From: yasser salman [mailto:yass71 at yahoo.com]
> Sent: Monday, April 12, 2004 1:53 PM
> To: insight-users at itk.org
> Cc: Luis Ibanez
> Subject: [Insight-users] segmented region size..
>
>
> hi all ..,
> how can i get the region size (or No. of pixels)
> after segmentation ,
> the code below give me the whole voulme size 256 x
> 256
> x19 i need only the segmented region ..,
> connectedThreshold->Update();
> ImageType::ConstPointer image =
> connectedThreshold->GetOutput();
> ImageType::RegionType region =
> image->GetBufferedRegion();
> ImageType::SizeType size = region.GetSize();
>
>
> thanx ,,
> yasser
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html