0

I have a dicom 3D image and additional file describing binary mask. Binary mask is encoded with XYZ coordinates:

5.123422, 6.123123, 5.123123; 5.123422, 6.123123, 5.123123; 5.123422, 6.123123, 5.123123 ...

I want to transform those encoded points into dicom (or other 3d format I can convert). Since dicom structure has fixed dimensions between its voxels and this structure is known. I am guessing that I can just read coordinates from file and set values of the points based on proximity. Are there better solutions?

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
andyPity
  • 15
  • 6

1 Answers1

1

This seems like a job for TransformPhysicalPointToIndex in a for loop:

for (auto p in points)
{
  auto index = maskImage->TransformPhysicalPointToIndex(p);
  maskImage->SetPixel(index, 255); // desired label
}

I don't think there are better solutions (based on my understanding of your problem).

Dženan
  • 3,329
  • 3
  • 31
  • 44