PET images read incorrectly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PET images read incorrectly

Tony Shepherd

I've had problems with erroneous values in dynamic PET images opened in ImageJ and think I've found the reason in the ImageJ source code.
The extract below is from ij.plugin.DICOM (or the attached screenshot), where 'dd' is the DicomDictionary. Follow the logic:- it does not apply the necessary rescaling if the data is signed 16-bit greyscale and the rescale slope is not 1.0. This is the case for my PET data and probably others.
 
if (Prefs.openDicomsAsFloat) {
        ip = ip.convertToFloat();
        if (dd.rescaleSlope!=1.0)
                ip.multiply(dd.rescaleSlope);
        if (dd.rescaleIntercept!=0.0)
                ip.add(dd.rescaleIntercept);
        imp.setProcessor(ip);
} else if (fi.fileType==FileInfo.GRAY16_SIGNED) {
        if (dd.rescaleIntercept!=0.0 && dd.rescaleSlope==1.0)
                ip.add(dd.rescaleIntercept);
} else if (dd.rescaleIntercept!=0.0 && (dd.rescaleSlope==1.0||fi.fileType==FileInfo.GRAY8)) {
        double[] coeff = new double[2];
        coeff[0] = dd.rescaleIntercept;
        coeff[1] = dd.rescaleSlope;
        imp.getCalibration().setFunction(Calibration.STRAIGHT_LINE, coeff, "Gray Value");
}    

ij.plugin.DICOM.jpg (63K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PET images read incorrectly

Rasband, Wayne (NIH/NIMH) [E]
On Apr 7, 2011, at 12:53 PM, Tony Shepherd wrote:

>
> I've had problems with erroneous values in dynamic PET images opened in ImageJ and think I've found the reason in the ImageJ source code.
> The extract below is from ij.plugin.DICOM (or the attached screenshot), where 'dd' is the DicomDictionary. Follow the logic:- it does not apply the necessary rescaling if the data is signed 16-bit greyscale and the rescale slope is not 1.0. This is the case for my PET data and probably others.

This bug is fixed in the 1.45f daily build. The DICOM reader converts the image to 32-bits and multiples by the rescale slope value if the Rescale Slope tag (0028,1053) exists and it has a value<>1.0.

-wayne


> if (Prefs.openDicomsAsFloat) {
>        ip = ip.convertToFloat();
>        if (dd.rescaleSlope!=1.0)
>                ip.multiply(dd.rescaleSlope);
>        if (dd.rescaleIntercept!=0.0)
>                ip.add(dd.rescaleIntercept);
>        imp.setProcessor(ip);
> } else if (fi.fileType==FileInfo.GRAY16_SIGNED) {
>        if (dd.rescaleIntercept!=0.0 && dd.rescaleSlope==1.0)
>                ip.add(dd.rescaleIntercept);
> } else if (dd.rescaleIntercept!=0.0 && (dd.rescaleSlope==1.0||fi.fileType==FileInfo.GRAY8)) {
>        double[] coeff = new double[2];
>        coeff[0] = dd.rescaleIntercept;
>        coeff[1] = dd.rescaleSlope;
>        imp.getCalibration().setFunction(Calibration.STRAIGHT_LINE, coeff, "Gray Value");
> }    <ij.plugin.DICOM.jpg>