]> Creatis software - clitk.git/blobdiff - itk/clitkResampleImageWithOptionsFilter.txx
Changment of cursor color value to keep the same color than before VTK8
[clitk.git] / itk / clitkResampleImageWithOptionsFilter.txx
index 9239afc4b5879f912a276424e9277db00868a320..97f6f418c56bc88c0937079060002285d5184758 100644 (file)
@@ -224,15 +224,18 @@ GenerateData()
     case B_LUT: std::cout << "B-LUT " << m_BSplineOrder << " " << m_BLUTSamplingFactor << std::endl; break;
     case WSINC: std::cout << "Windowed Sinc" << std::endl; break;
     }
+#if ITK_VERSION_MAJOR <= 4
     std::cout << "Threads        = " << this->GetNumberOfThreads() << std::endl;
+#else
+    std::cout << "Threads        = " << this->GetNumberOfWorkUnits() << std::endl;
+#endif
     std::cout << "LastDimIsTime  = " << m_LastDimensionIsTime << std::endl;
   }
 
   // Compute origin based on image corner
-  typename FilterType::OriginPointType origin = input->GetOrigin();
   for(unsigned int i=0; i<OutputImageType::ImageDimension; i++) {
-    origin[i] -= 0.5 * input->GetSpacing()[i];
-    origin[i] += 0.5 * m_OutputSpacing[i];
+    m_OutputOrigin[i] -= 0.5 * input->GetSpacing()[i];
+    m_OutputOrigin[i] += 0.5 * m_OutputSpacing[i];
   }
 
   // Instance of the transform object to be passed to the resample
@@ -240,9 +243,13 @@ GenerateData()
   filter->SetTransform(m_Transform);
   filter->SetSize(m_OutputSize);
   filter->SetOutputSpacing(m_OutputSpacing);
-  filter->SetOutputOrigin(origin);
+  filter->SetOutputOrigin(m_OutputOrigin);
   filter->SetDefaultPixelValue(m_DefaultPixelValue);
+#if ITK_VERSION_MAJOR <= 4
   filter->SetNumberOfThreads(this->GetNumberOfThreads());
+#else
+  filter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
+#endif
   filter->SetOutputDirection(m_OutputDirection); // <-- NEEDED if we want to keep orientation (in case of PermutAxes for example)
 
   // Select interpolator