[Insight-users] ROI Image filter

TienGarry gjtian at hotmail.com
Mon Dec 15 06:35:09 EST 2008


 
I want to process the image volume slice by slice, so I use RegionOfInterestImageFilter to extract one slice from the volume as following:
 
OutputImageType::SizeType size = filter->GetOutput()->GetLargestPossibleRegion().GetSize();    unsigned short slicenum = size[2];    OutputImageType::IndexType start =  filter->GetOutput()->GetLargestPossibleRegion().GetIndex(); 
    typedef itk::RegionOfInterestImageFilter< OutputImageType,         OutputImageType > ROIFilterType;
    ROIFilterType::Pointer roifilter = ROIFilterType::New();
    for ( unsigned short i = 0; i < slicenum; i++ )    {        start[2] = i;        size[2] = 1;        OutputImageType::RegionType desiredRegion;        desiredRegion.SetSize(  size  );        desiredRegion.SetIndex( start );
        roifilter->SetRegionOfInterest( desiredRegion );        roifilter->SetInput(filter->GetOutput());
        OutputImageType::SizeType roisize = roifilter->GetOutput()->GetLargestPossibleRegion().GetSize();        roifilter->Update();
}
 
But, I got roisize=[0,0,0], Anyone can help me?
Thx.
_________________________________________________________________
新版手机MSN,新功能,新体验!满足您的多彩需求!
http://mobile.msn.com.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081215/b63e3537/attachment.htm>


More information about the Insight-users mailing list