Plastimatch convert

475 views
Skip to first unread message

Laura Panizzi

unread,
Apr 15, 2013, 6:26:53 AM4/15/13
to plast...@googlegroups.com
Hi,
I'm trying to convert with plastimatch DICOM image in .mha format. I follow the instruction on the web site and it works, but with some images I've got wrong Origin, Spacing and Direction while the Size is right. Independently from the input image I get this values:

Origin = 0 0 0
Spacing = 1 1 1
Direction = 1 0 0 0 1 0 0 0 1

that seems to be default value.

I've open the same image with ImageJ and there the values are right (Origin = -120.48 -125.93 -4.7, Spacing = 0.89 0.89 3.4, Direction = 0.997 -0.03 0.06 0.06 0.91 -0.39 ).

Where is the problem?

Thanks,
Laura

Paolo Zaffino

unread,
Apr 15, 2013, 6:31:34 AM4/15/13
to plast...@googlegroups.com
Hi Laura,
which command are you using to convert the files?

Regards.
Paolo


Da: Laura Panizzi <laura....@gmail.com>
A: plast...@googlegroups.com
Inviato: Lunedì 15 Aprile 2013 12:26
Oggetto: [Plastimatch] Plastimatch convert

--
You received this message because you are subscribed to the Google Groups "Plastimatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plastimatch...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Laura Panizzi

unread,
Apr 15, 2013, 6:34:32 AM4/15/13
to plast...@googlegroups.com, Paolo Zaffino
Hi Paolo,

I use this command:

plastimatch convert --input dicomDIR --output-img img.mha

It works with almost all the images.

thanks,
Laura

Paolo Zaffino

unread,
Apr 15, 2013, 6:46:34 AM4/15/13
to plast...@googlegroups.com
Hi,
I think the command is right.
Are you trying to convert a dicom dataset (# 2D img > 1) into a 3D mha file, right? 
What are the real geometrical information that you read from the dicom header?
So some image set have no problem, while other set are wrong...did I understand well?

Paolo


Cc: Paolo Zaffino <p.za...@yahoo.it>
Inviato: Lunedì 15 Aprile 2013 12:34
Oggetto: Re: [Plastimatch] Plastimatch convert

Laura Panizzi

unread,
Apr 15, 2013, 7:15:30 AM4/15/13
to plast...@googlegroups.com, Paolo Zaffino
Yes, you understand well, I'm trying to convert dicom dataset into a 3D mha file.
The real geometrical information are:

0018,0088 Spacing Between Slices: 3.4
0020,0032 Image Position (Patient): -120.48 \ -125.93 \ -4.74
0020,0037 Image Orientation (Patient): 0.997 -0.038 0.066 0.061 0.917 -0.393 
0028,0030 Pixel Spacing: 0.898 0.898

while converting, in the command line I get instead:

Origin = 0 0 0
Spacing = 1 1 1
Direction = 1 0 0 0 1 0 0 0 1

This happen to me with two images, an anonymized PET and a dwi MR. 
I thought that could be the process of anonymizing the cause, but this time the image is not anonymized.

thanks,
Laura

Sharp, Gregory C.

unread,
Apr 15, 2013, 8:56:40 AM4/15/13
to plast...@googlegroups.com, Paolo Zaffino
It's possible there is a bug.  Could you share an (anonymized) image
that exhibits this problem?


From: plast...@googlegroups.com [mailto:plast...@googlegroups.com] On Behalf Of Laura Panizzi
Sent: Monday, April 15, 2013 7:16 AM
To: plast...@googlegroups.com
Cc: Paolo Zaffino
Subject: Re: [Plastimatch] Plastimatch convert

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Laura Panizzi

unread,
Apr 15, 2013, 11:07:37 AM4/15/13
to plast...@googlegroups.com, Paolo Zaffino, gcs...@partners.org
Hi Gregory,
this is one anonymized image, in attachment.

Thanks,
Laura
PETAnonym.zip

Sharp, Gregory C.

unread,
Apr 16, 2013, 10:59:56 AM4/16/13
to Laura Panizzi, plast...@googlegroups.com, Paolo Zaffino
Hi Laura,
 
Are you using dcmtk or gdcm build of plastimatch?
 
Greg


From: Laura Panizzi [mailto:laura....@gmail.com]
Sent: Monday, April 15, 2013 11:08 AM
To: plast...@googlegroups.com
Cc: Paolo Zaffino; Sharp, Gregory C.

Laura Panizzi

unread,
Apr 16, 2013, 12:52:58 PM4/16/13
to plast...@googlegroups.com, Laura Panizzi, Paolo Zaffino, gcs...@partners.org
Hi Greg,

I'm using gdcm build (on Mac Os)...I've installed the one that was selected by default, because I'm new on Plastimatch and ITK and I don't know the difference.

Thanks,
Laura

Sharp, Gregory C.

unread,
Apr 16, 2013, 12:55:21 PM4/16/13
to plast...@googlegroups.com, Paolo Zaffino
Hi Laura,
 
Sorry, one more question, which version of ITK?
 
(The ITK 3 comes with gdcm v1, but ITK 4 comes with gdcm v2.)
 
Greg


From: plast...@googlegroups.com [mailto:plast...@googlegroups.com] On Behalf Of Laura Panizzi
Sent: Tuesday, April 16, 2013 12:53 PM
To: plast...@googlegroups.com
Cc: 'Laura Panizzi'; Paolo Zaffino; Sharp, Gregory C.

Laura Panizzi

unread,
Apr 16, 2013, 1:49:12 PM4/16/13
to plast...@googlegroups.com, Paolo Zaffino, gcs...@partners.org
Hi Greg,

I have installed ITK 4.3.1.

Laura

Sharp, Gregory C.

unread,
Apr 16, 2013, 1:55:29 PM4/16/13
to plast...@googlegroups.com, Paolo Zaffino
Hi Laura,
 
OK.  Got it.  That is probably the problem. 
Unfortunately gdcm v2 is not supported.
 
Would you consider downgrading to ITK 3?
 
Another choice would be to re-build with dcmtk.
 
Greg


From: plast...@googlegroups.com [mailto:plast...@googlegroups.com] On Behalf Of Laura Panizzi
Sent: Tuesday, April 16, 2013 1:49 PM

Laura

unread,
Apr 17, 2013, 3:55:01 AM4/17/13
to plast...@googlegroups.com
Hi Gregory,

First of all I'll try to re-build plastimatch with dcmtk, It seems to me the simplest way.
Then if it doesn't works yet I'll try to downgrade to ITK 3.

Thank you very much,
Laura


2013/4/16 Sharp, Gregory C. <GCS...@partners.org>

--
You received this message because you are subscribed to a topic in the Google Groups "Plastimatch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plastimatch/RSeLg-rRG6w/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to plastimatch...@googlegroups.com.

Laura Panizzi

unread,
Apr 17, 2013, 6:05:17 AM4/17/13
to plast...@googlegroups.com, Paolo Zaffino, gcs...@partners.org
Hi Gregory,

finally I've installed ITK 3 and now it works!

thank you very much,
Laura

Laura Panizzi

unread,
Apr 17, 2013, 9:11:34 AM4/17/13
to plast...@googlegroups.com, Paolo Zaffino, gcs...@partners.org
Hi Gregory,

I'm still here...the new installation works via command line, but if I call plastimatch in Matlab, with the comman system('plastimatch convert --input --output-img') I get a wrong result.
With the same image, from command line I get:


The directory:
 .../Anonymous/CT

Contains the following DICOM Series:
 1.2.826.0.1.3680043.2.1322.2.6043718.36103110489.1.13.750000512512

Now reading series:
 1.2.826.0.1.3680043.2.1322.2.6043718.36103110489.1.13.750000512512

Setting PIH from M_IMG
PIH is:
Origin = -150 -150 -135.34
Size = 512 512 93
Spacing = 0.585938 0.585938 3.26999
Direction = 1 0 0 0 1 0 0 0 1
Rtds_warp: Saving m_img (ct.mha)
Trying to write image to ct.mha
Rtds_warp: warp and save ss.
Finished!

while, converting the same image in Matlab i get:

system('plastimatch convert --input .../Anonymous/CT --output-img ct.mha')

The directory: 
.../Anonymous/CT
Contains the following DICOM Series: 
1.2.826.0.1.3680043.2.1322.2.6043718.36103110489.1.13.750000512512
Now reading series: 
1.2.826.0.1.3680043.2.1322.2.6043718.36103110489.1.13.750000512512
Setting PIH from M_IMG
PIH is:
Origin = 0 0 0
Size = 0 0 93
Spacing = 1 1 1
Direction = 1 0 0 0 1 0 0 0 1
Rtds_warp: Saving m_img (ct.mha)
Trying to write image to ct.mha
ITK exception writing image file.

itk::ExceptionObject (0x101eb2f30)
Location: "void itk::ImageFileWriter<TInputImage>::Write() [with TInputImage = itk::Image<short int, 3u>]" 
File: /Users/lauracecypanizzi/Desktop/Topo/TesiMagistrale/InsightToolkit-3.20.1/Code/IO/itkImageFileWriter.txx
Line: 271
Description: itk::ERROR: ImageFileWriter(0x101eb1f00): Largest possible region does not fully contain requested paste IO regionPaste IO region: ImageIORegion (0x7fff5fbfe2d0)
  
Dimension: 3
Index: 0 0 0 
Size: 0 0 93 

Largest possible region: ImageRegion (0x7fff5fbfe390)
Dimension: 3
Index: [0, 0, 0] 
Size: [0, 0, 93]
Rtds_warp: warp and save ss.
Finished!

With the previous version of ITK/plastimatch I didn't have this problem.
Well, I did something in installation? Is It solvable or can I use plastimatch only from command line?

Thanks very much,
Laura
Reply all
Reply to author
Forward
0 new messages