- //--------------------------------------------------------------------
- // Final Step -> set output
- //this->SetNthOutput(0, working_image);
+ // loop ExtractImageFilter with region updated, push_back
+ typedef itk::ExtractImageFilter<ImageType, SliceType> ExtractImageFilterType;
+ typename ExtractImageFilterType::Pointer extract = ExtractImageFilterType::New();
+ extract->SetInput(input);
+ for(int i=0; i<m_NumberOfSlices; i++) {
+ extract = ExtractImageFilterType::New();
+ extract->SetInput(input);
+ m_index[GetDirection()] = start + i;
+ m_region.SetIndex(m_index);
+ extract->SetExtractionRegion(m_region);
+ extract->Update();
+ SetNthOutput(i, extract->GetOutput());
+ }