# \#simpleitk

**URL:** https://discourse.itk.org/tag/simpleitk/10.md?match_all_tags=true&page=4&tags%5B%5D=simpleitk

[Latest](https://discourse.itk.org/latest.md) · [Categories](https://discourse.itk.org/categories.md) · [Tags](https://discourse.itk.org/tags.md)

**Page:** 5

---

## [Setting up SimpleITK with anaconda](https://discourse.itk.org/t/setting-up-simpleitk-with-anaconda/6175)

<div class="topic-metadata">

**Author:** [@devo99](https://discourse.itk.org/u/devo99)\
**Replies:** 1\
**Last updated:** [September 4, 2023, 3:19pm UTC](https://discourse.itk.org/t/setting-up-simpleitk-with-anaconda/6175 "2023-09-04T15:19:07Z")

</div>

Hello there, I have been frustrated with getting SimpleITK working with jupyter past week. I have been following the instructions on this article : SimpleITK Tutorial . I have installed everything that is necessary. Ho…

---

## [Issue with mesh points interpolation from nifti DVF image volume](https://discourse.itk.org/t/issue-with-mesh-points-interpolation-from-nifti-dvf-image-volume/6171)

<div class="topic-metadata">

**Author:** [@isuruwi](https://discourse.itk.org/u/isuruwi)\
**Replies:** 4\
**Last updated:** [September 1, 2023, 11:31am UTC](https://discourse.itk.org/t/issue-with-mesh-points-interpolation-from-nifti-dvf-image-volume/6171 "2023-09-01T11:31:31Z")

</div>

Hi, I have generated deformed 3D-CT versions and corresponding deformation vector field (DVF) volumes of a given nifti image volume (reference image 3D-CT volume) using another tool. I then extracted the liver mesh from…

---

## [I am trying to copy all the metadata/header information from one image to another.](https://discourse.itk.org/t/i-am-trying-to-copy-all-the-metadata-header-information-from-one-image-to-another/6120)

<div class="topic-metadata">

**Author:** [@Cristobal\_Rodero](https://discourse.itk.org/u/Cristobal_Rodero)\
**Replies:** 2\
**Last updated:** [August 29, 2023, 7:29am UTC](https://discourse.itk.org/t/i-am-trying-to-copy-all-the-metadata-header-information-from-one-image-to-another/6120 "2023-08-29T07:29:24Z")

</div>

I have a segmentation (original\_image) that when I overlap it with the MRI image it comes from it overlaps as expected (comparing it in 3D Slicer, for instance). I perform some operations on Seg3D (or any other software …

---

## [Measure diameter of curved 3d tube](https://discourse.itk.org/t/measure-diameter-of-curved-3d-tube/6162)

<div class="topic-metadata">

**Author:** [@cams2b](https://discourse.itk.org/u/cams2b)\
**Replies:** 1\
**Last updated:** [August 24, 2023, 4:58pm UTC](https://discourse.itk.org/t/measure-diameter-of-curved-3d-tube/6162 "2023-08-24T16:58:26Z")

</div>

Hello everyone, I am working with a 3d curved tubular structure. I have extracted the centerline at various points and now I am trying to calculate the diameter of the tube at those points. At the curved regions, I am t…

---

## [Is it possible to convert to Hounsfield Units in Sitk?](https://discourse.itk.org/t/is-it-possible-to-convert-to-hounsfield-units-in-sitk/5061)

<div class="topic-metadata">

**Author:** [@DushiFdo](https://discourse.itk.org/u/DushiFdo)\
**Replies:** 5\
**Last updated:** [August 14, 2023, 12:56pm UTC](https://discourse.itk.org/t/is-it-possible-to-convert-to-hounsfield-units-in-sitk/5061 "2023-08-14T12:56:09Z")

</div>

Hi, Is there a function in SITK to convert the pixel values in dicom CT images to Hounsfield Units (HU) ? This is what I currently do: def transform\_to\_hu(slices): images = np.stack(\[file.pixel\_array for file in …

---

## [Centering an Image](https://discourse.itk.org/t/centering-an-image/6126)

<div class="topic-metadata">

**Author:** [@VHK](https://discourse.itk.org/u/VHK)\
**Replies:** 2\
**Last updated:** [August 4, 2023, 8:33am UTC](https://discourse.itk.org/t/centering-an-image/6126 "2023-08-04T08:33:44Z")

</div>

Hello, I have implemented the following code to move the center of gravity to the center of the image. The resulting image does not appear to be properly centered as expected. import itk import SimpleITK as sitk commo…

---

## [Inhomogeneity correction using N4 and Python](https://discourse.itk.org/t/inhomogeneity-correction-using-n4-and-python/6123)

<div class="topic-metadata">

**Author:** [@Cambridgeshire](https://discourse.itk.org/u/Cambridgeshire)\
**Replies:** 1\
**Last updated:** [August 1, 2023, 1:02pm UTC](https://discourse.itk.org/t/inhomogeneity-correction-using-n4-and-python/6123 "2023-08-01T13:02:18Z")

</div>

Hey dear supporters, I would like to perform inhomogeneity correction of head and pelvis NIfTI MRI images using Python. My code looks like this: Image = sitk.ReadImage(path) image = sitk.Cast(Image, sitk.sitkFloat32) …

---

## [how can I build simpleITK c++ windows version ?](https://discourse.itk.org/t/how-can-i-build-simpleitk-c-windows-version/6116)

<div class="topic-metadata">

**Author:** [@zx-lhb](https://discourse.itk.org/u/zx-lhb)\
**Replies:** 2\
**Last updated:** [August 1, 2023, 3:18am UTC](https://discourse.itk.org/t/how-can-i-build-simpleitk-c-windows-version/6116 "2023-08-01T03:18:45Z")

</div>

hi, I fllowed the instructions here build sitk to get simpleitk, but cmake came out errors like: Could NOT find LuaInterp. But I am working on Windows, how can I build SimpleITK on windows? Thank you ! Building SimpleIT…

---

## [Composite Transform error](https://discourse.itk.org/t/composite-transform-error/6108)

<div class="topic-metadata">

**Author:** [@CrownMella](https://discourse.itk.org/u/CrownMella)\
**Replies:** 8\
**Last updated:** [July 28, 2023, 8:24pm UTC](https://discourse.itk.org/t/composite-transform-error/6108 "2023-07-28T20:24:33Z")

</div>

Hello, I have two transforms: affine and displacementfield. When I apply them affine then df, it works well. I would like to create a composite transform. I read that they are in reverse order with the back being applie…

---

## [How to change classes labels](https://discourse.itk.org/t/how-to-change-classes-labels/6111)

<div class="topic-metadata">

**Author:** [@NimaY](https://discourse.itk.org/u/NimaY)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 6:47pm UTC](https://discourse.itk.org/t/how-to-change-classes-labels/6111 "2023-07-28T18:47:16Z")

</div>

Hi, I have 3 different labels in each masks where the classes order is like that: 0 - background, 1 - left lung, 2 - right lung. Is there a way to change it to: 0 - background, 1 - both lung? All of these masks a…

---

## [Reading GIFTI file in Python](https://discourse.itk.org/t/reading-gifti-file-in-python/6052)

<div class="topic-metadata">

**Author:** [@mcespedes99](https://discourse.itk.org/u/mcespedes99)\
**Replies:** 4\
**Last updated:** [July 27, 2023, 8:56pm UTC](https://discourse.itk.org/t/reading-gifti-file-in-python/6052 "2023-07-27T20:56:41Z")

</div>

Hi, I’m currently trying to develop an extension for 3D Slicer to read, import and convert GIFTI images. I’m developing this module in Python and I’m currently using nibabel to read the gifti files (both containing surf…

---

## [Coregistration of DICOM series with different resolutions](https://discourse.itk.org/t/coregistration-of-dicom-series-with-different-resolutions/6091)

<div class="topic-metadata">

**Author:** [@vstevensf](https://discourse.itk.org/u/vstevensf)\
**Replies:** 2\
**Last updated:** [July 25, 2023, 3:26pm UTC](https://discourse.itk.org/t/coregistration-of-dicom-series-with-different-resolutions/6091 "2023-07-25T15:26:33Z")

</div>

Hi – was just looking through the documentation for ITK/SimpleITK, with the goal of coregistering two DICOM series, but with different numbers of “slices” (images) per series. For example, coregistering a series of T2 Fl…

---

## [Speed Discrepancy between ITK and SimpleITK](https://discourse.itk.org/t/speed-discrepancy-between-itk-and-simpleitk/6070)

<div class="topic-metadata">

**Author:** [@JRopers](https://discourse.itk.org/u/JRopers)\
**Replies:** 7\
**Last updated:** [July 23, 2023, 11:22pm UTC](https://discourse.itk.org/t/speed-discrepancy-between-itk-and-simpleitk/6070 "2023-07-23T23:22:42Z")

</div>

Hello again! I am currently working on registration of CT images. Originally, I ran rigid registration in SimpleITK and this was quite fast for each iteration. Overall, the registration process finished after a couple …

---

## [Java SimpleITK Slice extraction and display with JavaFX](https://discourse.itk.org/t/java-simpleitk-slice-extraction-and-display-with-javafx/6055)

<div class="topic-metadata">

**Author:** [@Salu\_Ramos](https://discourse.itk.org/u/Salu_Ramos)\
**Replies:** 18\
**Last updated:** [July 20, 2023, 5:48pm UTC](https://discourse.itk.org/t/java-simpleitk-slice-extraction-and-display-with-javafx/6055 "2023-07-20T17:48:21Z")

</div>

Hi, i am trying to get a slice from any axis like axial, sagital or coronal from dicom volume, i already made it with python, but due to python limitations i migrate to java. this is how i load the volume: public sta…

---

## [RuntimeError with number of expected elements for DisplacementFieldTransform](https://discourse.itk.org/t/runtimeerror-with-number-of-expected-elements-for-displacementfieldtransform/6076)

<div class="topic-metadata">

**Author:** [@rtlim](https://discourse.itk.org/u/rtlim)\
**Replies:** 1\
**Last updated:** [July 18, 2023, 5:54pm UTC](https://discourse.itk.org/t/runtimeerror-with-number-of-expected-elements-for-displacementfieldtransform/6076 "2023-07-18T17:54:48Z")

</div>

I’m trying to create a DisplacementFieldTransform using a MetaImage that I’ve saved, but I’m getting a runtime error and I haven’t found anything online related to it. This is what the error says: RuntimeError: Exceptio…

---

## [How to get Metadata with SimpleITK in Java](https://discourse.itk.org/t/how-to-get-metadata-with-simpleitk-in-java/6066)

<div class="topic-metadata">

**Author:** [@Salu\_Ramos](https://discourse.itk.org/u/Salu_Ramos)\
**Replies:** 2\
**Last updated:** [July 13, 2023, 6:34pm UTC](https://discourse.itk.org/t/how-to-get-metadata-with-simpleitk-in-java/6066 "2023-07-13T18:34:56Z")

</div>

i have a dicom folder that contains many dicom files, i load then using this code: public static org.itk.simple.Image loadLocalFolder (Stage stage) throws Exception { String dicomFolderPath = LocalLoader.selectF…

---

## [Unable to perform simple image registration](https://discourse.itk.org/t/unable-to-perform-simple-image-registration/6053)

<div class="topic-metadata">

**Author:** [@sarthakpati](https://discourse.itk.org/u/sarthakpati)\
**Replies:** 1\
**Last updated:** [July 11, 2023, 2:48pm UTC](https://discourse.itk.org/t/unable-to-perform-simple-image-registration/6053 "2023-07-11T14:48:12Z")

</div>

Hi, Duplicate of Unable to perform simple image registration · Issue #1956 · SimpleITK/SimpleITK · GitHub, as I was directed to ask the question here. I am using SimpleITK-SimpleElastix since SimpleITK-2.2.1 seem to gi…

---

## [SimpleITK 2.3 Release Candidate 1](https://discourse.itk.org/t/simpleitk-2-3-release-candidate-1/6050)

<div class="topic-metadata">

**Author:** [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 3:04pm UTC](https://discourse.itk.org/t/simpleitk-2-3-release-candidate-1/6050 "2023-07-10T15:04:41Z")

</div>

Announcement Announcing the SimpleITK 2.3 Release Candidate 1! Users and developers are encouraged to test the RC before the final release and report issues, bugs, and any compatibility problems. Installing SimpleITK C…

---

## [How can I find coordinates of a point after resampling?](https://discourse.itk.org/t/how-can-i-find-coordinates-of-a-point-after-resampling/6046)

<div class="topic-metadata">

**Author:** [@Eloy\_Schultz](https://discourse.itk.org/u/Eloy_Schultz)\
**Replies:** 2\
**Last updated:** [July 10, 2023, 11:52am UTC](https://discourse.itk.org/t/how-can-i-find-coordinates-of-a-point-after-resampling/6046 "2023-07-10T11:52:42Z")

</div>

Suppose I apply a resampling operation to my image as below: resampler = sitk.ResampleImageFilter() resampler.SetSize(target\_size) resampler.SetOutputSpacing(target\_spacing) resampler.SetOutputOrigin(ori…

---

## [Java Convert int\[\] to VectorUInt32](https://discourse.itk.org/t/java-convert-int-to-vectoruint32/6037)

<div class="topic-metadata">

**Author:** [@Salu\_Ramos](https://discourse.itk.org/u/Salu_Ramos)\
**Replies:** 9\
**Last updated:** [July 7, 2023, 10:17pm UTC](https://discourse.itk.org/t/java-convert-int-to-vectoruint32/6037 "2023-07-07T22:17:55Z")

</div>

The SImpleITK.extract method requires 3 parameters: first is org.itk.simple.Image second is org.itk.simple.VectorUInt32 third is org.itk.simple.VectorInt32 i know whats are this parameters, i was able to reproduce this…

---

## [Resampling volume to axial view with SimpleITK](https://discourse.itk.org/t/resampling-volume-to-axial-view-with-simpleitk/6010)

<div class="topic-metadata">

**Author:** [@mortifiedpenguin](https://discourse.itk.org/u/mortifiedpenguin)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 12:38pm UTC](https://discourse.itk.org/t/resampling-volume-to-axial-view-with-simpleitk/6010 "2023-06-26T12:38:24Z")

</div>

Hi all, I want to resample medical volume datasets such that they are always oriented axial. I’ve managed to get it to work more or less using the following code (C# but should be clear enough:) Image l…

---

## [How to automatically refine segmentation warped by deformation field (from voxelmorph).](https://discourse.itk.org/t/how-to-automatically-refine-segmentation-warped-by-deformation-field-from-voxelmorph/5901)

<div class="topic-metadata">

**Author:** [@BraveDistribution](https://discourse.itk.org/u/BraveDistribution)\
**Replies:** 12\
**Last updated:** [June 15, 2023, 5:22am UTC](https://discourse.itk.org/t/how-to-automatically-refine-segmentation-warped-by-deformation-field-from-voxelmorph/5901 "2023-06-15T05:22:56Z")

</div>

Hello, I work on cardiac cycle analysis (TEE). We want to obtain a mask of the left ventricle (or any other region of interest) during the whole cycle based on the mask manually annotated in ED/ES (end of diastole/systo…

---

## [Parts of registered images missing.](https://discourse.itk.org/t/parts-of-registered-images-missing/5969)

<div class="topic-metadata">

**Author:** [@RobertTheSquirrel](https://discourse.itk.org/u/RobertTheSquirrel)\
**Replies:** 3\
**Last updated:** [May 29, 2023, 10:09pm UTC](https://discourse.itk.org/t/parts-of-registered-images-missing/5969 "2023-05-29T22:09:10Z")

</div>

Greetings! I am a uni student relatively new to image/file processing. I am encountering something which I view as an issue during the processing of my 3D images. For the record, what I do with the original DICOM images…

---

## [SetShrinkFactorsPerLevel anisotropically](https://discourse.itk.org/t/setshrinkfactorsperlevel-anisotropically/5964)

<div class="topic-metadata">

**Author:** [@ktdiedrich](https://discourse.itk.org/u/ktdiedrich)\
**Replies:** 2\
**Last updated:** [May 25, 2023, 7:42pm UTC](https://discourse.itk.org/t/setshrinkfactorsperlevel-anisotropically/5964 "2023-05-25T19:42:08Z")

</div>

Is there a way to set shrink factors anisotropically? This would be for cases when one dimension of an image is much thinner than the others so it doesn’t need as much shrinking. In Simple ITK it doesn’t work to pass Se…

---

## [Register two binary Images of different size and resolution](https://discourse.itk.org/t/register-two-binary-images-of-different-size-and-resolution/5936)

<div class="topic-metadata">

**Author:** [@Flo\_Van\_Wickeren](https://discourse.itk.org/u/Flo_Van_Wickeren)\
**Replies:** 6\
**Last updated:** [May 14, 2023, 9:32am UTC](https://discourse.itk.org/t/register-two-binary-images-of-different-size-and-resolution/5936 "2023-05-14T09:32:01Z")

</div>

Hello everyone, I am currently working on project, where i want to register 2 images of different modality. One image is a MALDI image with a low resolution (5um). The other image is an fluorescence image of the same se…

---

## [I need to extract only the brain portion excluding the skull from the CTA image. How can I do it using simpleITK filters? I tried otsu thresholding filters followed by connected components largest label but haven't got result i expected. Can someone help?](https://discourse.itk.org/t/i-need-to-extract-only-the-brain-portion-excluding-the-skull-from-the-cta-image-how-can-i-do-it-using-simpleitk-filters-i-tried-otsu-thresholding-filters-followed-by-connected-components-largest-label-but-havent-got-result-i-expected-can-someone-help/5935)

<div class="topic-metadata">

**Author:** [@arpan56](https://discourse.itk.org/u/arpan56)\
**Replies:** 4\
**Last updated:** [May 12, 2023, 5:10am UTC](https://discourse.itk.org/t/i-need-to-extract-only-the-brain-portion-excluding-the-skull-from-the-cta-image-how-can-i-do-it-using-simpleitk-filters-i-tried-otsu-thresholding-filters-followed-by-connected-components-largest-label-but-havent-got-result-i-expected-can-someone-help/5935 "2023-05-12T05:10:10Z")

</div>

otsu\_filter = sitk.OtsuThresholdImageFilter() otsu\_filter.SetInsideValue(0) otsu\_filter.SetOutsideValue(1) binary\_image = otsu\_filter.Execute(input\_image) cc\_filter = sitk.ConnectedComponentImageFilter() brain\_mask = cc…

---

## [Optimizer's stopping condition is rounding error. Registration framework](https://discourse.itk.org/t/optimizers-stopping-condition-is-rounding-error-registration-framework/4603)

<div class="topic-metadata">

**Author:** [@Luciano\_Rivetti](https://discourse.itk.org/u/Luciano_Rivetti)\
**Replies:** 4\
**Last updated:** [May 3, 2023, 8:19pm UTC](https://discourse.itk.org/t/optimizers-stopping-condition-is-rounding-error-registration-framework/4603 "2023-05-03T20:19:11Z")

</div>

Hi everyone, I’m doing B-Spline registration of CT vs CBCT images. The Registration method Im using is: registration\_method = sitk.ImageRegistrationMethod() grid\_physical\_spacing = \[15.0\]\*3 image\_physical\_size …

---

## [Output MRI images have value 0 (almost) everywhere after resampling using SimpleITK](https://discourse.itk.org/t/output-mri-images-have-value-0-almost-everywhere-after-resampling-using-simpleitk/5912)

<div class="topic-metadata">

**Author:** [@bluefire](https://discourse.itk.org/u/bluefire)\
**Replies:** 2\
**Last updated:** [May 2, 2023, 7:40am UTC](https://discourse.itk.org/t/output-mri-images-have-value-0-almost-everywhere-after-resampling-using-simpleitk/5912 "2023-05-02T07:40:28Z")

</div>

Hey! I have 3-dimensional NIfTI MRI images that I would like to resample to uniform voxel size (1, 1, 1). This works fine: img = sitk.ReadImage(img\_path) output\_spacing = \[1.0, 1.0, 1.0\] input\_spacing = img.GetSpacin…

---

## [Gantry tilt correction for list of DICOM images](https://discourse.itk.org/t/gantry-tilt-correction-for-list-of-dicom-images/5907)

<div class="topic-metadata">

**Author:** [@EthanHarvey98](https://discourse.itk.org/u/EthanHarvey98)\
**Replies:** 3\
**Last updated:** [May 1, 2023, 7:47pm UTC](https://discourse.itk.org/t/gantry-tilt-correction-for-list-of-dicom-images/5907 "2023-05-01T19:47:25Z")

</div>

Hello, I am working on writing my own gantry tilt correction function in Python. The function takes in a list of correctly ordered DICOM images loaded by pydicom, corrects each slice, and returns a corrected 3D image. d…

---

## [reads DCM volume with grid transform, python](https://discourse.itk.org/t/reads-dcm-volume-with-grid-transform-python/5878)

<div class="topic-metadata">

**Author:** [@Thirawat](https://discourse.itk.org/u/Thirawat)\
**Replies:** 2\
**Last updated:** [April 28, 2023, 4:38am UTC](https://discourse.itk.org/t/reads-dcm-volume-with-grid-transform-python/5878 "2023-04-28T04:38:25Z")

</div>

Hi all, I have Dicom file that contains Dicom volume grid transform so, I want to read Dicom with that transformation. now I can only read raw Dicom My code: def readDCM(folder\_path, win\_level=50, win\_width=100): …

[Previous page](https://discourse.itk.org/tag/simpleitk/10.md?match_all_tags=true&page=3&tags%5B%5D=simpleitk)

[Next page](https://discourse.itk.org/tag/simpleitk/10.md?match_all_tags=true&page=5&tags%5B%5D=simpleitk)
