]> Creatis software - clitk.git/blobdiff - itk/clitkExtractSliceFilter.txx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / itk / clitkExtractSliceFilter.txx
index deabdfc5cd53e8bb9128159d9b3eaa606e1c535b..e983be7c4dd3e96b28527c9d3ce13fabdc2c1f2f 100644 (file)
@@ -105,7 +105,11 @@ GenerateData() {
   m_size[GetDirection()] = 0;
   m_region.SetSize(m_size);
   int start = m_index[GetDirection()];
+#if ITK_VERSION_MAJOR >= 4
+  this->SetNumberOfIndexedInputs(m_NumberOfSlices);
+#else
   this->SetNumberOfOutputs(m_NumberOfSlices);
+#endif
 
   //--------------------------------------------------------------------
   // loop ExtractImageFilter with region updated, push_back
@@ -118,8 +122,11 @@ GenerateData() {
     m_index[GetDirection()] = start + i;
     m_region.SetIndex(m_index);
     extract->SetExtractionRegion(m_region);
+#if ITK_VERSION_MAJOR == 4
+    extract->SetDirectionCollapseToSubmatrix();
+#endif
     extract->Update();
-    SetNthOutput(i, extract->GetOutput());
+    this->SetNthOutput(i, extract->GetOutput());
   }
   return;
 }