# JPG file stack with different spacings

**URL:** <https://discourse.slicer.org/t/jpg-file-stack-with-different-spacings/3436>\
**Category:** Support\
**Created:** [July 9, 2018, 7:59pm UTC](https://discourse.slicer.org/t/jpg-file-stack-with-different-spacings/3436 "2018-07-09T19:59:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_Simha](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@Hari\_Simha](https://discourse.slicer.org/u/Hari_Simha)\
**Post date:** [July 9, 2018, 7:59pm UTC](https://discourse.slicer.org/t/jpg-file-stack-with-different-spacings/3436/1 "2018-07-09T19:59:53Z")

</div>

Hello

I am new to Slicer and am trying to construct a 3d volume from an image stack (jpeg or png). The application is in materials science. The spacing between the images in the stack are not the same.

Please advise as to how I could read this in.

Thanks

Hari

---

<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:** [July 10, 2018, 4:44am UTC](https://discourse.slicer.org/t/jpg-file-stack-with-different-spacings/3436/2 "2018-07-10T04:44:16Z")

</div>

If you read the image stack from DICOM then Slicer can create a grid (displacement field) transform that places each slice in their correct location. You can then harden the transform on the volume to create a uniformly spaced volume.

If you cannot get the input in DICOM format then you can adapt the [AcquisitionModeling](https://github.com/Slicer/Slicer/blob/b2b7068e5b795706b57b5337212d5b160408e20e/Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py#L523-L679) class of the DICOM reader to create the appropriate transform.
