[Insight-users] Re: DICOMApp.
Luis Ibanez
luis.ibanez@kitware.com
Wed, 26 Mar 2003 08:02:05 -0500
Hi Zhao,
The reason is probably that your DICOM file is 8bits
and the PNG file that is being created is 16bits.
If your viewer does not normalize the intensities, the
image will appear dark.
Please use the ITK viewer provided in
InsightApplications/MetaImageViewer,
Or use a tool like ImageMagick 'convert' in order to
renormalize the gray levels in the PNG image.
---------------------
In order to get information from the DICOM file,
you simply instantiate the ImageFileReader, and
after updating it, you interrogate its output.
For example,
typedef itk::ImageFileReader< ImageType > ReaderType;
ReaderType::Pointer reader = ReadertType::New();
reader->SetFileName("myImge.dcm");
reader->Update();
ImageType::Pointer image = reader->GetOutput();
ImageType::RegionType region =
image->GetLargestPossibleRegion();
const double * origin = image->GetOrigin();
const double * spacing = image->GetSpacing();
double spacingX = spacing[0];
double spacingY = spacing[1];
double spacingZ = spacing[2];
You will find details about this in the DatRepresentation
chapter of the SoftwareGuide.pdf
Regards,
Luis
---------------------
zhao yong qiang wrote:
Hi,
I use DICOMapp to change DICOM file to PNG file, but the obtained
PNG file is dark. Can someone tell me how to solve it?
Another question: how I can get the information from the DICOM file
in ITK, such as pixel spacing or slice thickness?
Sincerely,
Zhao Yongqiang
Dept. of Computer Science & Engineering
Shanghai JiaoTong University
Shanghai, China
zhao-yq@cs.sjtu.edu.cn
<mailto:zhao-yq@cs.sjtu.edu.cn>