# Is there any difference between nrrd converted by plastimatch and slicer? What algorithm is used by slicer to convert to nrrd

**URL:** <https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026>\
**Category:** Support\
**Tags:** nrrd\
**Created:** [April 20, 2023, 11:31am UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026 "2023-04-20T11:31:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_s\_umesh\_sherkhane](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/b_s_umesh_sherkhane/32/65688_2.png) [@b\_s\_umesh\_sherkhane](https://discourse.slicer.org/u/b_s_umesh_sherkhane)\
**Post date:** [April 20, 2023, 11:31am UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/1 "2023-04-20T11:31:45Z")

</div>

Hi ,  
I am trying to extract radiomics from PET dicom. I converted the dicom to nrrd using two methods.

1. using slicer i saved the image and mask to nrrd
2. Using plastimatch i converted the dicom to nrrd.  
When i run pyradiomics on the nrrds from slicer it works fine. but if i run pyradiomics on the plastimatch converted nrrds then radiomics extraction is going forever and hung.  
Any idea if there is any difference between the plstimatch and slicer nrrds? Can you also describe how slicer converts to nrrd, what algorithm is used ?

Thanks and regards

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [April 20, 2023, 3:58pm UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/2 "2023-04-20T15:58:38Z")

</div>

Hmm. Not sure why that would be. Plastimatch nrrds are created using ITK and are always compressed. Maybe pyradiomics needs an uncompressed nrrd?

Anyway, if you open the nrrd files with a text editor, you can look at the ASCII header. This might help you to debug. Or if you post both headers here I can take a look.

---

<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:** [April 20, 2023, 4:41pm UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/3 "2023-04-20T16:41:48Z")

</div>

ITK’s DICOM reader only works for simple Cartesian images (all slices are parallel, slice spacing is uniform, gantry is not tilted, etc.) and you may need to move all DICOM files into a different folder that do not belong to the series that you want to read.

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [April 20, 2023, 5:01pm UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/4 "2023-04-20T17:01:33Z")

</div>

@lassoan Yes, interesting idea. It might be related to import rather than export. Plastimatch does not use ITK for DICOM import.

---

<div class="post-metadata">

**Author:** ![b\_s\_umesh\_sherkhane](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/b_s_umesh_sherkhane/32/65688_2.png) [@b\_s\_umesh\_sherkhane](https://discourse.slicer.org/u/b_s_umesh_sherkhane)\
**Post date:** [April 24, 2023, 6:42am UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/5 "2023-04-24T06:42:33Z")

</div>

Hi Greg,

Thanks for the reply. here are the headers of the nrrd files

**1. slicer nrrd**

```auto
NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: double
dimension: 3
space: left-posterior-superior
sizes: 128 128 90
space directions: (2,0,0) (0,2,0) (0,0,2)
kinds: domain domain domain
endian: little
encoding: gzip
space origin: (-127.585938,-57.585937999999999,-358.5)

```

1. plastimatch nrrd

```auto
NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: float
dimension: 3
space: left-posterior-superior
sizes: 128 128 90
space directions: (2,0,0) (0,2,0) (0,0,2)
kinds: domain domain domain
endian: little
encoding: gzip
space origin: (-127.5859375,-57.5859375,-358.5)

```

---

<div class="post-metadata">

**Author:** ![b\_s\_umesh\_sherkhane](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/b_s_umesh_sherkhane/32/65688_2.png) [@b\_s\_umesh\_sherkhane](https://discourse.slicer.org/u/b_s_umesh_sherkhane)\
**Post date:** [April 24, 2023, 6:48am UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/6 "2023-04-24T06:48:05Z")

</div>

which package does plastimatch use to import the dicoms ?

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [May 8, 2023, 2:26pm UTC](https://discourse.slicer.org/t/is-there-any-difference-between-nrrd-converted-by-plastimatch-and-slicer-what-algorithm-is-used-by-slicer-to-convert-to-nrrd/29026/7 "2023-05-08T14:26:14Z")

</div>

Plastimatch uses dcmtk.

The only difference appears to be the type, and a bit of rounding in the origin. Can you try converting to double type?

`plastimatch convert --output-type double ...`
