# Creating ROI box markups in image coordinates (rather than anatomical coordinates)

**URL:** https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393
**Category:** Support
**Created:** [June 17, 2025, 4:44pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393 "2025-06-17T16:44:32Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![tvercaut](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tvercaut/32/80445_2.png) [@tvercaut](https://discourse.slicer.org/u/tvercaut)
#### Post date: [June 17, 2025, 4:44pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/1 "2025-06-17T16:44:32Z")

</div>

Hi,

I am interested in getting 3D box annotations in MRI data. ROI markups appear to be a good fit for this but the current behaviour is counterintuitive to users. In particular, they got confused by getting forced into creating “skewed” boxes, see snapshot below:

 ![Screenshot 2025-06-17 at 10.37.11](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/e/ee29f34f0612d02d651bdc4a5e2d963435518463.png)

It seems this comes from “conflicting” default behaviours in 3D Slicer. Indeed, by default, the MRI volume is loaded to display in image coordinates but the box ROI markups are created in anatomical coordinates. So it’s not a skew but rather an oblique clipping that is observed.

Anyway, I was thus wondering if there is an option to create box ROI markups that are aligned with image coordinates rather than anatomical ones. The UI and documentation don’t seem to indicate this is possible but probably I missed something:

> **[Markups — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/markups.html#roi-settings-section)**

If not from the UI, is it possible to customise `~/.slicerrc.py` or similar to introduce such a behaviour?

Best wishes,  
Tom

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 17, 2025, 4:48pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/2 "2025-06-17T16:48:39Z")

</div>

If you create ROI inside the Volume Rendering module, it will be aligned with respect to your rotated MRI image (and not be skewed) like that. There is sort of a related issue here:

> [@Resampling a linear transformation](https://discourse.slicer.org/t/resampling-a-linear-transformation/42916/7):
>
> I agree, this feature will make it easier to create an RAS-axis-aligned volume by resampling.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [June 17, 2025, 4:51pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/3 "2025-06-17T16:51:45Z")

</div>

Good point! Most of the time users would probably want to place the ROI with axes aligned with the slice view axes, so probably we should change the placement behavior (instead of making it configurable).

@muratmaga would this behavior would be an improvement for your workflows, too?

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 17, 2025, 4:55pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/4 "2025-06-17T16:55:46Z")

</div>

> [@lassoan](#):
>
> @muratmaga would this behavior would be an improvement for your workflows, too?

For us the biggest improvement would come enabling easier linear resampling after we manually align our microCT scans (which is the linked issue). If it is possible to do that both, that would be great.

---

<div class="post-metadata">

### Author: ![tvercaut](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tvercaut/32/80445_2.png) [@tvercaut](https://discourse.slicer.org/u/tvercaut)
#### Post date: [June 17, 2025, 6:22pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/5 "2025-06-17T18:22:51Z")

</div>

> [@muratmaga](#):
>
> If you create ROI inside the Volume Rendering module, it will be aligned with respect to your rotated MRI image (and not be skewed) like that.

I’m not sure I understand the suggestion. The behaviour is the same if I initiate the ROI markup in the volume rendering view. The box remains aligned with anatomical axes.

---

<div class="post-metadata">

### Author: ![tvercaut](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tvercaut/32/80445_2.png) [@tvercaut](https://discourse.slicer.org/u/tvercaut)
#### Post date: [June 17, 2025, 6:27pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/6 "2025-06-17T18:27:47Z")

</div>

> [@lassoan](#):
>
> Good point! Most of the time users would probably want to place the ROI with axes aligned with the slice view axes, so probably we should change the placement behavior (instead of making it configurable).

That default behaviour would be great for us.

I am currently thinking about using a workaround to display images in anatomical coordinates but it’s not ideal for downstream usage where voxel grid based box ROIs would be expected. We would need to compute the tightest box in image coordinates that encapsulates the anatomically aligned box. This makes the annotation process fuzzier than I would hope but makes for a slighly more intuitive operation for annotaters.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 17, 2025, 6:30pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/7 "2025-06-17T18:30:44Z")

</div>

> [@tvercaut](#):
>
> I’m not sure I understand the suggestion. The behaviour is the same if I initiate the ROI markup in the volume rendering view.

No, use the crop volume feature in the volume rendering module to create the ROI. Not the markups one.

---

<div class="post-metadata">

### Author: ![tvercaut](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tvercaut/32/80445_2.png) [@tvercaut](https://discourse.slicer.org/u/tvercaut)
#### Post date: [June 17, 2025, 6:44pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/8 "2025-06-17T18:44:40Z")

</div>

> [@muratmaga](#):
>
> No, use the crop volume feature in the volume rendering module to create the ROI. Not the markups one.

I found a crop volume module but no crop volume function in the volume rendering module:

> **[Crop Volume — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/cropvolume.html)**

I assume you refer to the former.

I confirm this generate image axis aligned box ROIs but it’s not super intuitive to use. I’ll have a hard time convincing people to use that for annotation purposes.

But given that the functionality is there and these ROIs show in the list of markups, maybe the default behaviour through the markup module can be hacked with a python hook in the short term?

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 17, 2025, 6:48pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/9 "2025-06-17T18:48:06Z")

</div>

See the screenshot for crop volume functionality in volume rendering.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/d/1d9c7579f4dca56c204b584ce661425e4e22f2ee.png)

It is the same ROI markups initialized different. I agree it is cumbersome. I only offered this since it is available to do what you want to do right now (as opposed to wait for implementation, and funding for it).

---

<div class="post-metadata">

### Author: ![tvercaut](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tvercaut/32/80445_2.png) [@tvercaut](https://discourse.slicer.org/u/tvercaut)
#### Post date: [June 17, 2025, 7:05pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/10 "2025-06-17T19:05:28Z")

</div>

Ah yes, clicking “Enable” and “Display ROI” next to “Crop” in the “volume rendering” module also works, albeit for a single box ROI. The path through the “crop volume” module allows creation of multiple box ROIs.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [September 27, 2025, 8:12pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/11 "2025-09-27T20:12:48Z")

</div>

for posterity this feature is now implemented in slicer, and part of the `CropVolume` module since Sept 21s.

> <https://github.com/Slicer/Slicer/pull/8737>
>
> Orientation of the input volume can now be easily fixed in Crop Volume module us…ing the new "Reorient volume" section.
> 
> Options are added to tune "Fit to volume" beheavior. It is now possible to align the cropped volume's ROI to the world coordinate system (or keep the current ROI orientation). This is useful if the user wants to align the cropped volume axes to the world coordinate system, for example to make segmentation in anatomical planes easier.
> 
> fixes #8415
> 
> \<img width="1282" height="1027" alt="image" src="https://github.com/user-attachments/assets/270c25cf-7b08-4f5d-9ac1-1da266aa824f" /\>
> 
> @muratmaga

To align your volume with anatomical planes, hit expand “reorient volume” tab, then use the widgets to transform your volume and harden it to finalize. If you want to create a new volume that’s in inline with the world axes, choose the `Align to world axis and resize` from the new drop down associated with Fit to Volume button. This will resample the oriented volume into the new grid and save the output to the output volume.

thanks for @lassoan implementing this.

---

<div class="post-metadata">

### Author: ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)
#### Post date: [September 28, 2025, 7:43am UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/12 "2025-09-28T07:43:43Z")

</div>

There was a fast and effective way to do that, as you suggested in an answer to one of my questions.

Reorient the slices with the Slice Plane Intersect with interaction enabled. Then, built the volume ROI and crop.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [September 28, 2025, 4:20pm UTC](https://discourse.slicer.org/t/creating-roi-box-markups-in-image-coordinates-rather-than-anatomical-coordinates/43393/13 "2025-09-28T16:20:01Z")

</div>

This is the same thing, integrated in a single module (CropVolume). You do the alignment, cropping and resampling all in one place…
