X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRTStruct2ImageFilter.cxx;h=96fdea75ed2415c7b2d699e6ce7dfd620f1cdd80;hb=5ee60b899362a5e87914ae9a46a7c8ea4116219b;hp=eb54bdc0b2cd626f7fca1c7f0a879890187f5656;hpb=9fd1972363586ac7872d54768889c39a706237fb;p=clitk.git diff --git a/common/clitkDicomRTStruct2ImageFilter.cxx b/common/clitkDicomRTStruct2ImageFilter.cxx index eb54bdc..96fdea7 100644 --- a/common/clitkDicomRTStruct2ImageFilter.cxx +++ b/common/clitkDicomRTStruct2ImageFilter.cxx @@ -202,18 +202,15 @@ void clitk::DicomRTStruct2ImageFilter::Update() mBinaryImage = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 mBinaryImage->SetScalarTypeToUnsignedChar(); +#endif mBinaryImage->SetOrigin(&origin[0]); mBinaryImage->SetSpacing(&mSpacing[0]); mBinaryImage->SetExtent(0, extend[0], 0, extend[1], 0, extend[2]); +#if VTK_MAJOR_VERSION <= 5 mBinaryImage->AllocateScalars(); #else - mBinaryImage->SetOrigin(&origin[0]); - mBinaryImage->SetSpacing(&mSpacing[0]); - mBinaryImage->SetExtent(0, extend[0], - 0, extend[1], - 0, extend[2]); mBinaryImage->AllocateScalars(VTK_UNSIGNED_CHAR, 1); #endif @@ -224,11 +221,13 @@ void clitk::DicomRTStruct2ImageFilter::Update() vtkSmartPointer extrude=vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 extrude->SetInput(mesh); + ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !) + extrude->SetVector(0, 0, -0.5*mSpacing[2]); #else extrude->SetInputData(mesh); -#endif ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !) - extrude->SetVector(0, 0, -mSpacing[2]); + extrude->SetVector(0, 0, 0.5*mSpacing[2]); +#endif // Binarization vtkSmartPointer sts=vtkSmartPointer::New(); @@ -239,7 +238,7 @@ void clitk::DicomRTStruct2ImageFilter::Update() #if VTK_MAJOR_VERSION <= 5 sts->SetInput(extrude->GetOutput()); #else - sts->SetInputData(extrude->GetOutput()); + sts->SetInputConnection(extrude->GetOutputPort(0)); #endif //sts->SetInput(mesh); @@ -247,7 +246,7 @@ void clitk::DicomRTStruct2ImageFilter::Update() #if VTK_MAJOR_VERSION <= 5 stencil->SetStencil(sts->GetOutput()); #else - stencil->SetStencilData(sts->GetOutput()); + stencil->SetStencilConnection(sts->GetOutputPort(0)); #endif #if VTK_MAJOR_VERSION <= 5 stencil->SetInput(mBinaryImage);