# Question related to ROI: preset voxel count or edge length in a square(rectangle effect) roi

**URL:** <https://discourse.slicer.org/t/question-related-to-roi-preset-voxel-count-or-edge-length-in-a-square-rectangle-effect-roi/11557>\
**Category:** Support\
**Created:** [May 15, 2020, 1:47pm UTC](https://discourse.slicer.org/t/question-related-to-roi-preset-voxel-count-or-edge-length-in-a-square-rectangle-effect-roi/11557 "2020-05-15T13:47:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kowloon](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kowloon](https://discourse.slicer.org/u/kowloon)\
**Post date:** [May 15, 2020, 1:47pm UTC](https://discourse.slicer.org/t/question-related-to-roi-preset-voxel-count-or-edge-length-in-a-square-rectangle-effect-roi/11557/1 "2020-05-15T13:47:34Z")

</div>

Operating system: Windows 10  
Slicer version: 4.10.2  
My problem is about drawing a rectangular ROI into a computed tomography. I have already drawn round ROIs, now I want to draw the same voxelcount as rectangular ROIs. With the HeterogeneityCAD I have already determined the voxel count of the round ROIs. I want to know where I can preset the edge lengths or the voxelcount for a rectangular ROI, if this is possible at all.  
Since I believe that my question is very specific, I address in particular @Iassoan and @federov.  
Many thanks in advance!!

---

<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:** [May 18, 2020, 6:08pm UTC](https://discourse.slicer.org/t/question-related-to-roi-preset-voxel-count-or-edge-length-in-a-square-rectangle-effect-roi/11557/2 "2020-05-18T18:08:32Z")

</div>

If you want to specify a region of interest by a segment programmatically, then a good option is to create one using a VTK source (for example, vtkCubeSource) and import it into a segmentation (as shown in [this example](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_histogram_of_a_segmented_region)).
