[Insight-users] about the dicom tag

Andinet Enquobahrie andinet.enqu at kitware.com
Wed Apr 12 06:39:40 EDT 2006


dk wrote:

> Dear all:
> I want to get the window width and window center tag from a dicom
> file. Is there a function that could get this?
> Thanks!
> Chris

Hi Chris.

You can do something like...

// dicom tag
std::string windowWidthTagKey;
std::string windowCenterTagKey;

// dicom tag string values...

windowWidthTagKey = "0028|1051"
windowCenterTagKey="0028|1050";

//extract the dictionary
itk::MetaDataDictionary & dict = m_ImageIO->GetMetaDataDictionary();

// extract windowWidth value
if ( itk::ExposeMetaData<std::string>(dict,windowWidthTagKey,windowWidth))
{
std::cout << "Window width tag value" << windowWidth << std::endl;
}
else
{
std:cerr << " Window width tag not found!" << std::endl;
}

// Something similar for window center also...

Give it a shot and let us know if you encounter any problems....

-Andinet




>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>  
>




More information about the Insight-users mailing list