<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-09-04 14:25 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi all,<br><br></div>I have multiple volumes in a renderer, positioned above/below each other (like a "string" of volumes) along the Z axis, none of them are intersecting. As the user clicks+drags the mouse in the viewport, I need to capture the mouse position at the start/end positions of the drag operation and convert them to world coordinates. I think I have these parts figured out.<br><br></div>Then, I need to search through the list of my volumes (sorted by their end positions in world coordinates), and construct a series of vtkExtractVOI that will extract the selected segments. For volumes that are completely inside the selected area, the vtkExtractVOI will extract the full volumes, but for the start/end volume (which may be the same volume), it will only extract a portion of it.<br><br></div>I looked at the vtkDataSet::FindPoint, which I think will give me a linear point ID (not familiar with that from before) for a point given in world coordinates. But how can I convert that to a structured point position that I can use when setting up the extent to use for my vtkExtractVOI?<br><br></div>Is the static vtkStructuredData::<wbr>ComputePointStructuredCoords helper the function I'm looking for? Or is there some other easier way to extract an area of a volume when the area is expressed in world coordinates? (specifically, as a start/end Z position in world coordinates).<br><br>Here's an ASCII drawing that perhaps explains better what I want to do, the rectangular areas are my volumes:<br><br>^ +-----+<br>| | |<br>| | P1 | <--- User clicks here (world coordinate X, Y, Z)..<br>| | |<br>Z +-----+<br> +-----+<br> | |<br> | |<br> +-----+<br> +-----+<br> | |<br> | |<br> | P2 | <--- ..and drags to here (world coordinate A, B, C).<br> | |<br> | |<br> | |<br> +-----+<br><br>From this I want to create three vtkExtractVOI, that when combined gives a list of vtkImageData that represents the selected area along the Z axis (in the X and Y direction, everything from the volumes should be included).<br></div></div></div></div></blockquote><div><br></div><div>To clarify, the X and Y coordinate of the click/release position are irrelevant here. I'll only capture the Z positions (Z0 and Z1), and from that I want to extract all voxels from my volumes that are between Z0 and Z1.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><br></div>Thanks in advance,<br></div>Elvis<br></div><br><br></div>
</blockquote></div><br></div></div>