How to know the order of dcm images
Moderator: Moderator Team
How to know the order of dcm images
Hi all
I'm new to the world of DICOM. I noticed that the order of the pictures (in order to set a volume), is not by the name index. I would like to load them into memory and order them in correct way so I will have the correct volume memory. How can I know the order ?
Thanks
Audi
I'm new to the world of DICOM. I noticed that the order of the pictures (in order to set a volume), is not by the name index. I would like to load them into memory and order them in correct way so I will have the correct volume memory. How can I know the order ?
Thanks
Audi
-
- DCMTK Developer
- Posts: 2049
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi,
for sorting slices we do not have any functionality in DCMTK. However, for the general procedure, just search the DICOM newsgroup for slice sortingand the like.
HTH and good luck,
Michael
for sorting slices we do not have any functionality in DCMTK. However, for the general procedure, just search the DICOM newsgroup for slice sortingand the like.
HTH and good luck,
Michael
Hi,
I had the same problem yesterday: i had to load a volume stored in multiple .dcm files named like slice001-slice002-...-slice407 but, slice number was not bounded to its physical position. I solved sorting them with the DICOM tag DCM_SliceLocation.
If you need more help i can post you some code.
Bye
I had the same problem yesterday: i had to load a volume stored in multiple .dcm files named like slice001-slice002-...-slice407 but, slice number was not bounded to its physical position. I solved sorting them with the DICOM tag DCM_SliceLocation.
If you need more help i can post you some code.
Bye
Thanks Mario, I will be glad for some code to see as referenceMario wrote:Hi,
I solved sorting them with the DICOM tag DCM_SliceLocation.
If you need more help i can post you some code.
Bye
You can send it to audi02@walla.com
Mario, I tried to do the follow,
But the function findAndGetFloat64 failed and gives nothing.
Code: Select all
// get slice position
double dValue;
VECTOR vSlicePosition;
if (fileformat.getDataset()->findAndGetFloat64(DCM_SliceLocationVector,dValue,0).good())
{
vSlicePosition.x = (float)dValue;
}
if (fileformat.getDataset()->findAndGetFloat64(DCM_SliceLocationVector,dValue,1).good())
{
vSlicePosition.y = (float)dValue;
}
if (fileformat.getDataset()->findAndGetFloat64(DCM_SliceLocationVector,dValue,2).good())
{
vSlicePosition.z = (float)dValue;
}
But the function findAndGetFloat64 failed and gives nothing.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
It's easy: SliceLocationVector is of type DS (Decimal String) and findAndGetFloat64() is not applicable to this VR as you can read in the documentation. Btw, the next snapshot (and upcoming) release will contain a getFloat64Vector() method, which is also applicable to Decimal Strings.
With regard to the original question, you should have a look at this.
With regard to the original question, you should have a look at this.
Maybe i had a differend problem but I solved using:
I applied that to each .dcm file and then sorted them.
Bye
Code: Select all
OFString slice_location;
OFCondition status = file_format.getDataset()->findAndGetOFString( DCM_SliceLocation, slice_location );
double double_slice_location = atof( slice_location.c_str() );
Bye
Thanks! That worked for me!Mario wrote:Maybe i had a differend problem but I solved using:I applied that to each .dcm file and then sorted them.Code: Select all
OFString slice_location; OFCondition status = file_format.getDataset()->findAndGetOFString( DCM_SliceLocation, slice_location ); double double_slice_location = atof( slice_location.c_str() );
Bye
Who is online
Users browsing this forum: Google [Bot] and 1 guest