I am trying to obtain the values named in the subject to calculate the volume of a heart from a set of slices.
I always obtain 0 in both values, and i know it is not correct, because I have opened the dicom secuence using an external tool and I have checked the correct values.
I think the problem is in the type this information is saved.
This is the code I have:
DcmDataset *data=dfile.getDataset();
Uint16 grosor, distancia;
data->findAndGetUint16(DCM_SpacingBetweenSlices, distancia);
data->findAndGetUint16(DCM_SliceThickness, grosor);
Can anybody help me?
Problem obtaining SpacingBetweenSlices and SliceThickness
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Problem obtaining SpacingBetweenSlices and SliceThicknes
What do the findAndGetUint16() calls return, i.e. what is the status? I don't think that SpacingBetweenSlices and SliceThickness are actually stored as Unsigned Short (US) values, so calling findAndGetUint16() is not appropriate as you can read in the API documentation. However, findAndGetFloat64() should work for Decimal String (DS).
Re: Problem obtaining SpacingBetweenSlices and SliceThicknes
Thank you, now I've tried to use Float64 as type of the variables and findAndGetFloat64 as function and it works.
The problem is solved, thank you so much.
The problem is solved, thank you so much.
Who is online
Users browsing this forum: Google [Bot] and 1 guest