I want to add a grid like the one in the picture to the 3D view.
The grid can be scaled as the view is scaled.
But the grid cannot be rotated or moved.
Please tell me what to do, Thank.
We provide a reference grid for transformvisualization. You can specify the grid size in mm and so it is properly scaled and it is shown in both slice and 3D views. However, I think it does not do exactly what you describe because in 3D we display a 3D grid not a 2D grid:
If you have C++ programming experience it would not be hard to copy the reference grid display from the 2D transform displayable manager](Slicer/vtkMRMLTransformsDisplayableManager2D.cxx at main · Slicer/Slicer · GitHub), in 3D it could be implemented similarly to how the ruler is displayed (it gets scaling from the main renderer, but it displays the 2D line always in the camera plane):
That said, using reference grid for measurement has many shortcomings compared to direct measurements (using markups line, curve, etc.), such as:
- approximate visual alignment with grid lines is less accurate and more error-prone (you may make a mistake when counting grid points or when you write down the results)
- no evidence of the measurement is preserved, therefore if you need to later review the results you don’t know if inaccuracy is due to incorrectly identifying landmark points, inaccurately aligning grid lines, or incorrectly counting grid points
Therefore, I would recommend to use markups for measurements instead of spending time with implementing a less reliable measurement solution. If you have questions on how to do your measurements using markups then let us know.
That’s taken care of, thank you.
What did you end up doing?