# Conversion of .jpg files into DICOM in MRI images

**URL:** <https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153>\
**Category:** Support\
**Tags:** dicom\
**Created:** [November 12, 2024, 5:10pm UTC](https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153 "2024-11-12T17:10:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benedettabottelli](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@benedettabottelli](https://discourse.slicer.org/u/benedettabottelli)\
**Post date:** [November 12, 2024, 5:10pm UTC](https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153/1 "2024-11-12T17:10:21Z")

</div>

I have three different folders containing .jpg images of three different views of a shoulder MRI (axial, coronal, sagittal). How can I convert them into DICOM format? Additionally, if I upload the sequences as they are, 3D Slicer treats all the folders as axial views and does not differentiate them. How can I change this? How can I upload everything as a single volume?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [November 13, 2024, 2:52pm UTC](https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153/2 "2024-11-13T14:52:21Z")

</div>

If you only have jpg then you will have trouble working in 3D. You’ll need to figure out the geometry that has already been thrown away by the conversion. You should really get original dicom images that contain the scan parameters needed to reconstruct.

---

<div class="post-metadata">

**Author:** ![benedettabottelli](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@benedettabottelli](https://discourse.slicer.org/u/benedettabottelli)\
**Post date:** [November 18, 2024, 7:37am UTC](https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153/3 "2024-11-18T07:37:58Z")

</div>

So, is it not possible to set in 3D Slicer what type of view I am considering? Also, to check if it treats the slices as a 3D volume, do I need dimensions of NxNxN?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [November 18, 2024, 4:05pm UTC](https://discourse.slicer.org/t/conversion-of-jpg-files-into-dicom-in-mri-images/40153/4 "2024-11-18T16:05:18Z")

</div>

If you are reading the data from jpg then the orientation and spacing information is lost and you need to reconstruct it manually to map it back to patient space. The needed transforms are described here:

[https://slicer.readthedocs.io/en/latest/user\_guide/coordinate\_systems.html](https://slicer.readthedocs.io/en/latest/user_guide/coordinate_systems.html)

One way to do this is to save the volume in into a nrrd file and then edit the header to fill in the missing data.

[https://teem.sourceforge.net/nrrd/format.html](https://teem.sourceforge.net/nrrd/format.html)
