How to crop 3D image from a 2D free-hand ROI?

When analysis 3D image data by rendering, some tissue is unconcerned and it would distrub the analysis. Thus, I want to crop the image by a free-hand ROI just like RadiAnt:

In the above picture, the green polygon is the ROI, and I want to crop the outside image. The result would be:

And we can focus on the intrested arteries.

If I have the vtkImageData and the 2D coordiante of ROI, how can I crop the image? Does anybody implement the similar function?

This feature is implemented in 3D Slicer (Segment Editor / Scissors effect). You can use it as is, or use the source code in your application, or customize Slicer to do exactly what you need.

It is a little hard for me to retrive the correct pipeline to crop the image by 2D ROI. Could you please tell me briefly about the pipelien so that I can find the details from the source code.

You may add a few breakpoints and step through the code using the debugger to see how it works exactly.

If you find this too complicated and you are implementing a medical imaging application then probably it would make more sense to create your application by customizing/extending Slicer. It has been developed exactly for this purpose for decades, and for tens of millions of dollars.

Hello,have you implemented this feature yet

Is the code available?