Thread Subject: Converting tiff into dicom

Subject: Converting tiff into dicom

From: aarti

Date: 2 Jul, 2009 18:02:02

Message: 1 of 6

Hi,

I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.

Thank you for your reply in advance.

-Aarti

Subject: Converting tiff into dicom

From: Jeff Mather

Date: 13 Jul, 2009 18:27:03

Message: 2 of 6

Hi Aarti,

This task is quite nontrivial, perhaps even rather difficult depending on the information that you're trying to store. There are dozens of different DICOM "information objects" (IODs) for most of the various kinds of medical imagery you can think of (e.g., MR, CT, ultrasound, visible light, X-Ray angiography, radiotherapy planning, etc.).

The DICOMWRITE function will attempt to write any DICOM IOD that you give it, but it really only knows about the appropriate values for three image types:

* Secondary capture (SC)
* Computed tomography (CT)
* Magnetic resonance (MR)

And it really only can create SC images from scratch. (To write any of the other IODs, you need to use the 'CreateMode' parameter with a value of 'Copy'.) These files have a very limited set of metadata, mostly patient-related. If you're lucky, that's enough. Try writing an image with DICOMWRITE's simplest syntax and then look at the output of DICOMINFO on that file to see if that's sufficient.

In general, to add the appropriate medical information to a DICOM file, it helps to start with another DICOM file. If you have a DICOM file of the same kind that you want to convert your TIFF files into, do this:

1) Load the metadata using DICOMINFO.
2) Change the metadata to the values you want to store.
3) Write the file using DICOMWRITE, giving it the image from the TIFF file and the metadata from step 2. For example, "dicomwrite(X, info, 'createmode', 'copy')".

Be aware that it's very easy to add meaningless or misleading values to DICOM files using this method. Unfortunately, DICOM is complicated this way. See Part 3 of the DICOM standard at http://medical.nema.org/ for a very extensive list of metadata attributes, their meanings, and acceptable values.

Good luck.

Jeff Mather
Image Processing Group
The MathWorks, Inc.


"aarti" <raheja.aarti@gmail.com> wrote in message <h2ismq$jbs$1@fred.mathworks.com>...
> Hi,
>
> I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.
>
> Thank you for your reply in advance.
>
> -Aarti

Subject: Converting tiff into dicom

From: aarti

Date: 13 Jul, 2009 19:22:03

Message: 3 of 6

Hi Jeff,

I already found a solution to this problem and it is quite similar to what you have suggested.

1. I first convert the tiff file to dicom file without adding any new metadata.
2. Then I add the required information to the metadata created by matlav while writing the dicom file
3. Then I use the dicomwrite function using "dicomwrite(X, info, 'createmode', 'copy')"

The problem I was having initially was, if you dont use the "dicomwrite(X, info, 'createmode', 'copy')" while writing a dicomfile matlab changes some of the metadata information you have included in it on its own. Hence it was not retaining the ips information to calibrate the dicom files.

Anyways it is working now. Thank you for your reply. I appreciate it.

"Jeff Mather" <jeff.mather@mathworks.com> wrote in message <h3fu9n$ln7$1@fred.mathworks.com>...
> Hi Aarti,
>
> This task is quite nontrivial, perhaps even rather difficult depending on the information that you're trying to store. There are dozens of different DICOM "information objects" (IODs) for most of the various kinds of medical imagery you can think of (e.g., MR, CT, ultrasound, visible light, X-Ray angiography, radiotherapy planning, etc.).
>
> The DICOMWRITE function will attempt to write any DICOM IOD that you give it, but it really only knows about the appropriate values for three image types:
>
> * Secondary capture (SC)
> * Computed tomography (CT)
> * Magnetic resonance (MR)
>
> And it really only can create SC images from scratch. (To write any of the other IODs, you need to use the 'CreateMode' parameter with a value of 'Copy'.) These files have a very limited set of metadata, mostly patient-related. If you're lucky, that's enough. Try writing an image with DICOMWRITE's simplest syntax and then look at the output of DICOMINFO on that file to see if that's sufficient.
>
> In general, to add the appropriate medical information to a DICOM file, it helps to start with another DICOM file. If you have a DICOM file of the same kind that you want to convert your TIFF files into, do this:
>
> 1) Load the metadata using DICOMINFO.
> 2) Change the metadata to the values you want to store.
> 3) Write the file using DICOMWRITE, giving it the image from the TIFF file and the metadata from step 2. For example, "dicomwrite(X, info, 'createmode', 'copy')".
>
> Be aware that it's very easy to add meaningless or misleading values to DICOM files using this method. Unfortunately, DICOM is complicated this way. See Part 3 of the DICOM standard at http://medical.nema.org/ for a very extensive list of metadata attributes, their meanings, and acceptable values.
>
> Good luck.
>
> Jeff Mather
> Image Processing Group
> The MathWorks, Inc.
>
>
> "aarti" <raheja.aarti@gmail.com> wrote in message <h2ismq$jbs$1@fred.mathworks.com>...
> > Hi,
> >
> > I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.
> >
> > Thank you for your reply in advance.
> >
> > -Aarti

Subject: Converting tiff into dicom

From: Rene

Date: 10 Dec, 2010 15:37:05

Message: 4 of 6

Hi aarti,
I am new to Mathlab I have read that you found a solution for my dicomize problem. I also want to convert a tiff file to dicom. I just don't know where to start. How do I dicomize a tiff file and which meta data is required? Hope you can help me out.


"aarti" <raheja.aarti@gmail.com> wrote in message <h3g1gr$1p6$1@fred.mathworks.com>...
> Hi Jeff,
>
> I already found a solution to this problem and it is quite similar to what you have suggested.
>
> 1. I first convert the tiff file to dicom file without adding any new metadata.
> 2. Then I add the required information to the metadata created by matlav while writing the dicom file
> 3. Then I use the dicomwrite function using "dicomwrite(X, info, 'createmode', 'copy')"
>
> The problem I was having initially was, if you dont use the "dicomwrite(X, info, 'createmode', 'copy')" while writing a dicomfile matlab changes some of the metadata information you have included in it on its own. Hence it was not retaining the ips information to calibrate the dicom files.
>
> Anyways it is working now. Thank you for your reply. I appreciate it.
>
> "Jeff Mather" <jeff.mather@mathworks.com> wrote in message <h3fu9n$ln7$1@fred.mathworks.com>...
> > Hi Aarti,
> >
> > This task is quite nontrivial, perhaps even rather difficult depending on the information that you're trying to store. There are dozens of different DICOM "information objects" (IODs) for most of the various kinds of medical imagery you can think of (e.g., MR, CT, ultrasound, visible light, X-Ray angiography, radiotherapy planning, etc.).
> >
> > The DICOMWRITE function will attempt to write any DICOM IOD that you give it, but it really only knows about the appropriate values for three image types:
> >
> > * Secondary capture (SC)
> > * Computed tomography (CT)
> > * Magnetic resonance (MR)
> >
> > And it really only can create SC images from scratch. (To write any of the other IODs, you need to use the 'CreateMode' parameter with a value of 'Copy'.) These files have a very limited set of metadata, mostly patient-related. If you're lucky, that's enough. Try writing an image with DICOMWRITE's simplest syntax and then look at the output of DICOMINFO on that file to see if that's sufficient.
> >
> > In general, to add the appropriate medical information to a DICOM file, it helps to start with another DICOM file. If you have a DICOM file of the same kind that you want to convert your TIFF files into, do this:
> >
> > 1) Load the metadata using DICOMINFO.
> > 2) Change the metadata to the values you want to store.
> > 3) Write the file using DICOMWRITE, giving it the image from the TIFF file and the metadata from step 2. For example, "dicomwrite(X, info, 'createmode', 'copy')".
> >
> > Be aware that it's very easy to add meaningless or misleading values to DICOM files using this method. Unfortunately, DICOM is complicated this way. See Part 3 of the DICOM standard at http://medical.nema.org/ for a very extensive list of metadata attributes, their meanings, and acceptable values.
> >
> > Good luck.
> >
> > Jeff Mather
> > Image Processing Group
> > The MathWorks, Inc.
> >
> >
> > "aarti" <raheja.aarti@gmail.com> wrote in message <h2ismq$jbs$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.
> > >
> > > Thank you for your reply in advance.
> > >
> > > -Aarti

Subject: Converting tiff into dicom

From: aarti

Date: 10 Dec, 2010 16:41:05

Message: 5 of 6

If you look at the reply posted above by me and Jeff, it is very easy to understand. After trying it if you get stuck somewhere then just let me know.


"Rene " <nonews@emailaddress.nl> wrote in message <idthf1$n9o$1@fred.mathworks.com>...
> Hi aarti,
> I am new to Mathlab I have read that you found a solution for my dicomize problem. I also want to convert a tiff file to dicom. I just don't know where to start. How do I dicomize a tiff file and which meta data is required? Hope you can help me out.
>
>
> "aarti" <raheja.aarti@gmail.com> wrote in message <h3g1gr$1p6$1@fred.mathworks.com>...
> > Hi Jeff,
> >
> > I already found a solution to this problem and it is quite similar to what you have suggested.
> >
> > 1. I first convert the tiff file to dicom file without adding any new metadata.
> > 2. Then I add the required information to the metadata created by matlav while writing the dicom file
> > 3. Then I use the dicomwrite function using "dicomwrite(X, info, 'createmode', 'copy')"
> >
> > The problem I was having initially was, if you dont use the "dicomwrite(X, info, 'createmode', 'copy')" while writing a dicomfile matlab changes some of the metadata information you have included in it on its own. Hence it was not retaining the ips information to calibrate the dicom files.
> >
> > Anyways it is working now. Thank you for your reply. I appreciate it.
> >
> > "Jeff Mather" <jeff.mather@mathworks.com> wrote in message <h3fu9n$ln7$1@fred.mathworks.com>...
> > > Hi Aarti,
> > >
> > > This task is quite nontrivial, perhaps even rather difficult depending on the information that you're trying to store. There are dozens of different DICOM "information objects" (IODs) for most of the various kinds of medical imagery you can think of (e.g., MR, CT, ultrasound, visible light, X-Ray angiography, radiotherapy planning, etc.).
> > >
> > > The DICOMWRITE function will attempt to write any DICOM IOD that you give it, but it really only knows about the appropriate values for three image types:
> > >
> > > * Secondary capture (SC)
> > > * Computed tomography (CT)
> > > * Magnetic resonance (MR)
> > >
> > > And it really only can create SC images from scratch. (To write any of the other IODs, you need to use the 'CreateMode' parameter with a value of 'Copy'.) These files have a very limited set of metadata, mostly patient-related. If you're lucky, that's enough. Try writing an image with DICOMWRITE's simplest syntax and then look at the output of DICOMINFO on that file to see if that's sufficient.
> > >
> > > In general, to add the appropriate medical information to a DICOM file, it helps to start with another DICOM file. If you have a DICOM file of the same kind that you want to convert your TIFF files into, do this:
> > >
> > > 1) Load the metadata using DICOMINFO.
> > > 2) Change the metadata to the values you want to store.
> > > 3) Write the file using DICOMWRITE, giving it the image from the TIFF file and the metadata from step 2. For example, "dicomwrite(X, info, 'createmode', 'copy')".
> > >
> > > Be aware that it's very easy to add meaningless or misleading values to DICOM files using this method. Unfortunately, DICOM is complicated this way. See Part 3 of the DICOM standard at http://medical.nema.org/ for a very extensive list of metadata attributes, their meanings, and acceptable values.
> > >
> > > Good luck.
> > >
> > > Jeff Mather
> > > Image Processing Group
> > > The MathWorks, Inc.
> > >
> > >
> > > "aarti" <raheja.aarti@gmail.com> wrote in message <h2ismq$jbs$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.
> > > >
> > > > Thank you for your reply in advance.
> > > >
> > > > -Aarti

Subject: Converting tiff into dicom

From: K P

Date: 28 Dec, 2010 22:57:05

Message: 6 of 6

Hi,

I am also trying to convert multiple tif images into dicom image. I am able to attach metadata details and i am able to attach one tif image using dicomwrite function. But how can we attach all the tif images into the single dicom file using dicomwrite ?
I tried appending the images and then attaching but that results in multiple images in a single frame but i need one image per frame.
Can you please tell me how to go about it.
Thanks in advance !!

Kamlesh

"aarti" <raheja.aarti@gmail.com> wrote in message <h2ismq$jbs$1@fred.mathworks.com>...
> Hi,
>
> I am trying to convert a bunch of tiff images into dicom image using Matlab's dicomread. I have to attach more details to the metadata like the patient id and patient name. The problem I am having is when I view these dicom images in PACS they are not calibrated. I know the image ips, so I used this information to calibrate the dicom images by storing it in the metadata. But it is not working. Is there any other information I need to store in the metadata along with this.
>
> Thank you for your reply in advance.
>
> -Aarti

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
tif K P 28 Dec, 2010 17:59:21
multple images K P 28 Dec, 2010 17:59:21
images K P 28 Dec, 2010 17:59:21
multiple K P 28 Dec, 2010 17:59:21
dicomwrite K P 28 Dec, 2010 17:59:21
dicom K P 28 Dec, 2010 17:59:21
tiff dicom Rene 10 Dec, 2010 10:39:52
metadata Jeff Mather 13 Jul, 2009 14:29:09
dicomwrite Jeff Mather 13 Jul, 2009 14:29:09
dicominfo Jeff Mather 13 Jul, 2009 14:29:09
metadata aarti 2 Jul, 2009 14:04:03
tiff aarti 2 Jul, 2009 14:04:03
dicom aarti 2 Jul, 2009 14:04:03
rssFeed for this Thread

Contact us at files@mathworks.com