I have a problem in developing a DICOM viewer using LEADTOOLS 17.0.
I successfully could get DICOM voxel information using TAG_PIXEL_DATA.
And I can get x- and y-spacing (actual dimension) of DICOM CT data by using TAG_PIXEL_SPACING.
The problem is that retrieving z-spacing of DICOM data with TAG_SPACING_BETWEEN_SLICES.
The return value is always NULL for every DICOM sample data.
I found another tag - TAG_SLICE_THICKNESS -, but it gives a wrong z-slicing value.
The proper value can be checked with my VTK source code.
Does anyone who knows about this problem?
I put my code snippet below, and attached the source code of my function.
Thank you.
/////////////////////////////////////////
// Silce thickness
pElement = pDataSet->FindFirstElement( NULL, TAG_SLICE_THICKNESS, FALSE );
L_DOUBLE* pSliceThickness = NULL;
if( pElement != NULL )
{
pSliceThickness = pDataSet->GetDoubleValue( pElement, 0, 0 );
m_sliceThickness = pSliceThickness[0];
}
// Spacing between slices
pElement = pDataSet->FindFirstElement( NULL, TAG_SPACING_BETWEEN_SLICES, FALSE );
L_DOUBLE* pSpacingBetweenSlices = NULL;
if( pElement != NULL ) // --> Always NULL !!!!
{
pSpacingBetweenSlices = pDataSet->GetDoubleValue( pElement, 0, 0 );
m_sliceThickness = pSpacingBetweenSlices[0];
}