1

I have a 3D image and a sphere equation. I need to take out all the voxels that are outside the circle and want to apply a transformation to them. How do I differentiate those points from all the points? I'm not understanding how to actually write the code to access each voxel that satisfies my criteria.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
Cndu
  • 57
  • 8

1 Answers1

2

Start from this iterator example. Use image->TransformIndexToPhysicalPoint(). Apply your sphere equation to physical point coordinates to determine whether a pixel is inside or outside. If you want to modify pixel values, it.Set(newValue); should do it. Possibly look at other iterator examples.

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