DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2018-08-20, 23:47

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri, 2018-02-23, 14:28 
Offline

Joined: Fri, 2018-02-23, 14:13
Posts: 2
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?


Top
 Profile  
 
PostPosted: Fri, 2018-02-23, 14:50 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1963
Location: Oldenburg, Germany
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).


Top
 Profile  
 
PostPosted: Fri, 2018-02-23, 14:57 
Offline

Joined: Fri, 2018-02-23, 14:13
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group