hi,ereryone,anybody can give me some advise about the setting new pixelvalue 
for the mitkImage
the question is
now i have a data volume, and in this volume at one direction there are slice 
between number 10 to number 20  with Segmentation, but i want to delete all the 
segmentation between slice number 11 to number 19, that means i must set the 
pixel value from 1 to 0, but the segmentation slice 10 and slice 20 must be 
stored.

i use first this class to get the every slice image.
ExtractImageFilter::Pointer extractor= ExtractImageFilter::New();

then i use this function to convert the mitk Image to Itk Image, and 
ItkImageChangePixel is one template function
AccessFixedDimensionByItk( SliceImage, ItkImageChangePixel, 2 );

template<typename TPixel, unsigned int VImageDimension>
void mitk::SegmentationInterpolationController::ItkImageChangePixel( 
itk::Image<TPixel,VImageDimension>* itkImage )
{

  typedef itk::ImageRegionIterator< itk::Image<TPixel,VImageDimension> >      
IteratorType;
  IteratorType iter( itkImage, itkImage->GetLargestPossibleRegion() );

 // typedef itk::ImageSliceIteratorWithIndex<itk::Image<TPixel,VImageDimension> 
>    IteratorIndexType;
 // IteratorIndexType iter( itkImage, itkImage->GetLargestPossibleRegion() );

  iter.GoToBegin();

  while ( !iter.IsAtEnd() )
  {
      iter.Set( 0 );
      ++iter;
    
  }

but if i run the program, it ist always crushed. can anybody tell me some 
advise.

Thank you

best regards

 
 
_________________________________________________________________
MSN 中文网,最新时尚生活资讯,白领聚集门户。
http://cn.msn.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to