|
| 1 | +#include "AlignMeshCLP.h" |
| 2 | + |
| 3 | + |
| 4 | +// VTK Includes |
| 5 | +#include "vtkDecimatePro.h" |
| 6 | +#include "vtkXMLPolyDataWriter.h" |
| 7 | +#include "vtkXMLPolyDataReader.h" |
| 8 | +#include "vtkSmartPointer.h" |
| 9 | +#include "vtkPolyData.h" |
| 10 | +#include "vtkTriangleFilter.h" |
| 11 | +#include "vtkNew.h" |
| 12 | +#include "vtkCellLocator.h" |
| 13 | + |
| 14 | +//ITK Includes |
| 15 | +#include "itkMesh.h" |
| 16 | +#include "itkMeshFileReader.h" |
| 17 | +#include "itkMeshFileWriter.h" |
| 18 | +#include "itkLineCell.h" |
| 19 | +#include "itkTriangleCell.h" |
| 20 | +#include "itkImageFileWriter.h" |
| 21 | +#include "itkResampleImageFilter.h" |
| 22 | +#include "itkConstrainedValueAdditionImageFilter.h" |
| 23 | +#include "itkBSplineInterpolateImageFunction.h" |
| 24 | +#include "itkPluginUtilities.h" |
| 25 | +#include <itkDefaultDynamicMeshTraits.h> |
| 26 | +#include <itkMetaMeshConverter.h> |
| 27 | + |
| 28 | + |
| 29 | +int main (int argc, char * argv[]) |
| 30 | + { |
| 31 | + PARSE_ARGS; |
| 32 | + try{ |
| 33 | + typedef itk::DefaultDynamicMeshTraits<float, 3, 3, float, float> MeshTraitsType; |
| 34 | + |
| 35 | + |
| 36 | + typedef MeshTraitsType::PointType PointType; |
| 37 | + |
| 38 | + constexpr unsigned int Dimension = 3; |
| 39 | + using InputPixelType = float; |
| 40 | + |
| 41 | + |
| 42 | + using MeshType = itk::Mesh<InputPixelType, Dimension>; |
| 43 | + using MeshReaderType = itk::MeshFileReader<MeshType>; |
| 44 | + |
| 45 | + using MeshWriterType = itk::MeshFileWriter<MeshType>; |
| 46 | + |
| 47 | + MeshReaderType::Pointer meshReader = MeshReaderType::New(); |
| 48 | + meshReader->SetFileName(inputVolume.c_str()); |
| 49 | + // meshReader->Update(); |
| 50 | + MeshType::Pointer mesh = meshReader->GetOutput(); |
| 51 | + MeshType::PointsContainerPointer Points = mesh->GetPoints(); |
| 52 | + int numberOfPoints = Points->Size(); |
| 53 | + |
| 54 | + MeshReaderType::Pointer meshReader2 = MeshReaderType::New(); |
| 55 | + meshReader2->SetFileName(inputVolumeTwo.c_str()); |
| 56 | + // meshReader->Update(); |
| 57 | + MeshType::Pointer mesh2 = meshReader2->GetOutput(); |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + MeshWriterType::Pointer writer = MeshWriterType::New(); |
| 64 | + writer->SetInput(mesh); |
| 65 | + writer->SetFileName(outputVolume.c_str()); |
| 66 | + //writer->Update(); |
| 67 | + |
| 68 | + |
| 69 | + } |
| 70 | + catch (int e) |
| 71 | + { |
| 72 | + cout << "An exception occurred. Exception Nr. " << e << '\n'; |
| 73 | + return EXIT_FAILURE; |
| 74 | + } |
| 75 | + return EXIT_SUCCESS; |
| 76 | + |
| 77 | +} |
0 commit comments