Obviously, is out of the volume box, even I setup handle positions values way below these values (45 < 367, etc.). I have search several examples of how to feed these values, but I didn’t find something proper.
You specify widget 3D position in rendering (physical) coordinate system, which is not the same as the volume’s voxel coordinate system (you need to to translate, rotate, and scale the axes).
Placement and editing of spline curves, panoramic X-ray reconstruction from curve, nerve segmentation by curve placement, DICOM import/export, segmentation, quantification, registration, surgical planning and guidance, etc. are all readily available in 3D Slicer, for free, without restrictions, even for commercial use. It is unnecessary to redevelop all these low-level features from scratch.
All of those trials tell me that my input values are outside of volume bounds (+++0).
Convenience function computes the structured coordinates for a point x.
The voxel is specified by the array ijk, and the parametric coordinates
in the cell are specified with pcoords. The function returns a 0 if the
** * point x is outside of the volume, and a 1 if inside the volume.**
virtual int ComputeStructuredCoordinates(
const double x, int ijk, double pcoords);
This ComputeStructuredCoordinates surely cannot be used in general, because it has no input for axis directions.
To get 3D point position from 2D click position then you need point picking, not just voxel<->physical coordinate system transformation.
If you find that it takes too much time to implement point placement yourself then you can use 3D Slicer. Everything is nicely and conveniently implemented in it, so you don’t need to deal with such low-level details (and if anything is not clear then you can get step-by-step instructions and examples on the Slicer forum). If you prefer to work it out yourself then you can have a look at how this is implemented in existing VTK-based open-source applications, such as ParaView, 3D Slicer, MITK Workbench, etc.