# Cropping a ROI in a sequence node using python

**URL:** <https://discourse.slicer.org/t/cropping-a-roi-in-a-sequence-node-using-python/25802>\
**Category:** Support\
**Tags:** python\
**Created:** [October 20, 2022, 8:51am UTC](https://discourse.slicer.org/t/cropping-a-roi-in-a-sequence-node-using-python/25802 "2022-10-20T08:51:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl-Philippe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/karl-philippe/32/14413_2.png) [@Karl-Philippe](https://discourse.slicer.org/u/Karl-Philippe)\
**Post date:** [October 20, 2022, 8:52am UTC](https://discourse.slicer.org/t/cropping-a-roi-in-a-sequence-node-using-python/25802/1 "2022-10-20T08:52:00Z")

</div>

Hello,

I am working with large ultrasound tracking sequences (.mha files) and I need to crop the ultrasound signal from the monitor background. I have tried the “Crop volume” extension to crop the image sequence as a volume), but it doesn’t work because I need to keep the tracking information and export the sequence metafile to an .mha file. I also tried to use the “crop volume sequence” module directly but after I select the parameters and start cropping, the sequence takes a long time to process and Slicer crashes. So, how to crop a spatial ROI from a 2D image sequence (“vtkMRMLScalarVolumeNode”) using the 3D Slicer user interface or possibly using Python?

Thank you,
