[Insight-users] calculate size of region in mm.

yasser salman yass71 at yahoo.com
Fri Jun 17 07:48:52 EDT 2005


Hi luis..,
 i'm using connectedthresholed image filter to segment
the tumor region 

this is the part of calculating the no of pixels:

.
.
.
 
itk::RelabelComponentImageFilter<SegmentedImageType,SegmentedImageType>
RelabelImageFilter;
RelabelImageFilter::Pointer rcfilter=
RelabelImageFilter::New();
rcfilter->SetInput(connectedThreshold->GetOutput());  
rcfilter->Update();

std::vector<unsigned long>::const_iterator it;
const std::vector<unsigned long> sizeOfObjects =
rcfilter->GetSizeOfObjectsInPixels();
it =  sizeOfObjects.begin();
cout<<"No. of pixels ="<<*it<<"\n";

this code is working good but if i wanna to calculate
size of region in mm i changed   "sizeOfObjects =
rcfilter->GetSizeOfObjectsInPixels();" TO 
sizeOfObjects =
rcfilter->GetSizeOfObjectsInPhysicalUnits();

The following erroe occured:

"D:\InsightToolkit-1.6.0\Code\BasicFilters\
itkRelabelComponentImageFilter.h (129): error C2440:
'return' : cannot convert from 'const class
std::vector<float,class std::allocator<float> >' to
'const class std::vector<unsigned long,class
std::allocator<unsigned long> > &'Reason: cannot
convert from 'const class std::vector<float,class
std::allocator<float> >' to 'const class
std::vector<unsigned long,class
std::allocator<unsigned long> >'
 No constructor could take the source type, or
constructor overload resolution was ambiguous 
D:\InsightToolkit-1.6.0\Code\BasicFilters\itkRelabelComponentImageFilter.h(129)
: while compiling class-template member function
'const class std::vector<unsigned long,class
std::allocator<unsigned long> > &__thiscall
itk::RelabelComponentIm
ageFilter<class itk::Image<unsigned short,3>,class
itk::Image<unsigned short,3>
>::GetSizeOfObjectsInPhysicalUnits(void) const'
Error executing cl.exe."

should i change type def of the vector *it* or is
there any mismathing in the typedef i did it?
regard's
yasser


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Insight-users mailing list