X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkMeshToBinaryImageFilter.txx;h=cd9a3bafbbc2a421b780a7f837df371429345b98;hb=6986b996d66273ab7818c12f51cbf5ae049ac04e;hp=be482f5232dc0320c61022943e4b2bc72e5d628e;hpb=8a0630aa62e19e238b7e2dd5d84ce03d49bdd23f;p=clitk.git diff --git a/itk/clitkMeshToBinaryImageFilter.txx b/itk/clitkMeshToBinaryImageFilter.txx index be482f5..cd9a3ba 100644 --- a/itk/clitkMeshToBinaryImageFilter.txx +++ b/itk/clitkMeshToBinaryImageFilter.txx @@ -30,7 +30,7 @@ //-------------------------------------------------------------------- template clitk::MeshToBinaryImageFilter:: -MeshToBinaryImageFilter():itk::ImageSource() +MeshToBinaryImageFilter() : itk::ImageSource(), m_Extrude(true) { } //-------------------------------------------------------------------- @@ -102,11 +102,23 @@ GenerateData() sts->SetInformationInput(binary_image); // Extrusion - vtkSmartPointer extrude=vtkSmartPointer::New(); - extrude->SetInput(m_Mesh); - // We extrude in the -slice_spacing direction to respect the FOCAL convention - extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]); - sts->SetInput(extrude->GetOutput()); + if (m_Extrude) + { + vtkSmartPointer extrude=vtkSmartPointer::New(); + extrude->SetInput(m_Mesh); + // We extrude in the -slice_spacing direction to respect the FOCAL convention + extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]); + sts->SetInput(extrude->GetOutput()); + + // When extrude ScaleFactor indicate the extrusion scaling (default = 1) + /* + extrude->SetScaleFactor(m_LikeImage->GetSpacing()[2]/2.0); + DD(extrude->GetScaleFactor()); + DD(extrude->GetCapping()); + */ + } + else + sts->SetInput(m_Mesh); // Stencil vtkSmartPointer stencil=vtkSmartPointer::New();