X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkMeshToBinaryImageFilter.txx;h=cd9a3bafbbc2a421b780a7f837df371429345b98;hb=961dac803b3b2688ed296b33606f938ca9dcd94a;hp=77252584885783336cde934ed433a83d81d3677b;hpb=696f91c7395f8545b7eed5f308a39a4c056822dc;p=clitk.git diff --git a/itk/clitkMeshToBinaryImageFilter.txx b/itk/clitkMeshToBinaryImageFilter.txx index 7725258..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(); @@ -134,7 +146,7 @@ GenerateData() m_Exporter->SetInput( stencil->GetOutput() ); m_Importer->Update(); - writeImage(m_Importer->GetOutput(), "f.mhd"); + // writeImage(m_Importer->GetOutput(), "f.mhd"); this->SetNthOutput(0, m_Importer->GetOutput());