| Summary: | Problem reading Pixel Spacing from DICOM file | ||
|---|---|---|---|
| Product: | Examples/Extended | Reporter: | Ken Sutherland <kensuth> |
| Component: | medical/DICOM | Assignee: | Jonathan Madsen <jonathan.madsen> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | ||
| Priority: | P4 | ||
| Version: | 10.4 | ||
| Hardware: | All | ||
| OS: | All | ||
Thanks, committed the fix. |
The code as is skips over the first byte of the Y-coordinate. This is not a problem is the pixel spacing is less than one mm because "0.1" will be read as ".1". But if pixel spacing is equal to or greater than 1 mm, it causes the Y pixel spacing to be zero because "1.0" is read as ".0". I think the code should be like this: } else if(tagDictionary == 0x00280030 ) { // Pixel Spacing G4String datas(data); int iss = datas.find('\\'); fPixelSpacingX = atof( datas.substr(0,iss).c_str() ); // NOTE: Skips first character of Y spacing! //fPixelSpacingY = atof( datas.substr(iss+2,datas.length()).c_str() ); fPixelSpacingY = atof( datas.substr(iss+1,datas.length()).c_str() );