NII -> DICOM

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

NII -> DICOM

#1 Post by katschiwa »

Hello everybody first of all, this is my first post here. I hope you can help me with a problem I have! This is my workflow:
DICOM -> NIFTY -> edit nifty file (add maps etc.) -> DICOM
My problem is the conversion back into DICOM. Do you have any suggestion how to realize this? I know that there are programs which can do this but I need to process huge amounts of files automaticly (script).

Regarding the header it would maybe be smart to be able to take the header of the original file and edit it.

Best,
C

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: NII -> DICOM

#2 Post by Michael Onken »

Hi,

what is "nifty"?

If you like to edit the header of the new images, you might use dcmodify that comes with DCMTK.

Best,
Michael

J. Riesmeier
DCMTK Developer
Posts: 2505
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: NII -> DICOM

#3 Post by J. Riesmeier »


katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

Re: NII -> DICOM

#4 Post by katschiwa »

Thanks for posting the link.
Michael: Thanks - even though I guess that editing the header will be the smalles problem I have to face.

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: NII -> DICOM

#5 Post by Michael Onken »

Now that I know nifty, I agree. I guess nobody from the DICOM team in OFFIS has experience with that, maybe some forum users know something, good luck :)

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

Re: NII -> DICOM

#6 Post by Per »

It is difficult, and dangerous. Be aware that the nifti format usually lacks some critical information that DICOM needs, and safely restoring a proper DICOM volume from a nifti volume is not possible as a general case.

If you have a known, fixed workflow, as I think is what you described, you can restore a DICOM series by utilizing information from the original DICOM series. However, to do this you need to not only know what you are doing, but also make sure you restrict the freedom to change things around while the data is in the nifti stage.

katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

Re: NII -> DICOM

#7 Post by katschiwa »

Yes, I'm aware of the lower information content of the nifti format. I do have a fixed workflow. I thought about taking information which is still the same (age, sex...) from the original file and edit the critical fields. Its also "just" for research purposes so no patient is in danger.
Could you outline your idea how to achieve the conversion, Per?

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

Re: NII -> DICOM

#8 Post by Per »

Basically, just export the nifti data that you have to DICOM using the official niftilib, then fill in the holes with data supplied from the original DICOM series.

Incidentially, I have been writing a program to do such a conversion, but I never finished it. Since it looks like weather will turn sour this weekend, I might just feel inspired to complete it :) If not, I can turn the unfinished code over to you. Unfortunately, it is not written using DCMTK.

Nag me if I forget.

katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

Re: NII -> DICOM

#9 Post by katschiwa »

Either way .. that would really help Per, thanks! I'll send you a PM with my email.
have a nice weekend everybody!

katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

Re: NII -> DICOM

#10 Post by katschiwa »

Am I blind or is there no PM system integrated in this forum? Anyway - Per I would still be happy about any line of code you already did. Maybe you can upload it somewhere?

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: NII -> DICOM

#11 Post by Michael Onken »

Hi C,

we disabled PM due to SPAM misuse. Since we now only permit manual registration for the same reason, we will discuss enabling PM in the future.

Best,
Michael

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

Re: NII -> DICOM

#12 Post by Per »

Per wrote:Since it looks like weather will turn sour this weekend, I might just feel inspired to complete it :)
This turned out to be a fine weekend, so I did not feel inclined to do much programming, but I have something that "should have worked" now, except it doesn't, and I just need to figure out why. :? If you just want some example code, you can look at http://gitorious.org/zzdicom (see nifti directory). I will let you know when I have something that at least passes my own tests.

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

Re: NII -> DICOM

#13 Post by Per »

Now it should work. Mind you, it will only work with modern multi-frame DICOM files.

To use, run
./zzdcm2nifti mydicomfile mynewniftifile
Then edit 'mynewniftifile'. Finally,
./zzniftistitch mydicomfile mynewniftifile mynewdicomfile
Now 'mynewdicomfile' should contain your modifications to 'mynewniftifile' but still be a valid DICOM file with good positioning information.

katschiwa
Posts: 6
Joined: Mon, 2012-06-25, 12:21

Re: NII -> DICOM

#14 Post by katschiwa »

Thanks a lot! I will have a look at it this weekend!

buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Re: NII -> DICOM

#15 Post by buiductoan »

In the your case, you must convert to DICOM to NII file. What is library name that is used to convert? Because I want to convert to DICOM to NII in C++. Thank you

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest