83#ifndef ITK_WASM_NO_MEMORY_IO
84 if (!this->
m_PointSet.IsNull() && !this->m_Identifier.empty())
87 auto pointSetToWasmPointSetFilter = PointSetToWasmPointSetFilterType::New();
88 pointSetToWasmPointSetFilter->SetInput(this->
m_PointSet);
89 pointSetToWasmPointSetFilter->Update();
90 auto wasmPointSet = pointSetToWasmPointSetFilter->GetOutput();
96 const auto pointsAddress =
reinterpret_cast<size_t>(&(wasmPointSet->GetPointSet()->GetPoints()->at(0)));
97 const auto pointsSize = wasmPointSet->GetPointSet()->GetPoints()->Size() *
98 sizeof(
typename PointSetType::CoordinateType) * PointSetType::PointDimension;
102 if (this->
m_PointSet->GetPointData() !=
nullptr && this->m_PointSet->GetPointData()->Size() > 0)
104 using PointPixelType =
typename PointSetType::PixelType;
106 const auto pointDataAddress =
reinterpret_cast<size_t>(&(wasmPointSet->GetPointSet()->GetPointData()->at(0)));
107 const auto pointDataSize = wasmPointSet->GetPointSet()->GetPointData()->Size() *
108 sizeof(
typename ConvertPointPixelTraits::ComponentType) *
109 ConvertPointPixelTraits::GetNumberOfComponents();
114 std::cerr <<
"Memory IO not supported" << std::endl;
120#ifndef ITK_WASM_NO_FILESYSTEM_IO
121 if (!this->
m_PointSet.IsNull() && !this->m_Identifier.empty())
125 auto pointSetWriter = PointSetWriterType::New();
127 typename MeshType::Pointer mesh = MeshType::New();
128 mesh->SetPoints(
const_cast<typename MeshType::PointsContainer *
>(this->
m_PointSet->GetPoints()));
129 mesh->SetPointData(
const_cast<typename MeshType::PointDataContainer *
>(this->
m_PointSet->GetPointData()));
130 pointSetWriter->SetInput(mesh);
131 pointSetWriter->Update();
134 std::cerr <<
"Filesystem IO not supported" << std::endl;