Skip to content
Permalink
Browse files

Fixes #332. Problems were related to images having 16bit pixel depth …

…and color palette
  • Loading branch information...
brizolara committed Jul 4, 2018
1 parent 42243b0 commit de6848068b561ffac2b8dd5a791a2a19168e1748
Showing with 2 additions and 6 deletions.
  1. +2 −6 DCM Framework/DCMPixelDataAttribute.mm
@@ -2769,9 +2769,7 @@ - (NSData *)convertPaletteToRGB:(NSData *)data
{
for( x = 0; x < width; x++)
{
if (clutDepthR != 16 || clutDepthG != 16 || clutDepthB != 16)
pixelR = pixelG = pixelB = bufPtr[y*width + x];
else pixelR = pixelG = pixelB = bufPtr16[y*width + x];
pixelR = pixelG = pixelB = bufPtr[y*width + x];

if( pixelR > clutEntryR) { pixelR = clutEntryR-1;}
if( pixelG > clutEntryG) { pixelG = clutEntryG-1;}
@@ -2854,7 +2852,7 @@ - (NSData *)convertPaletteToRGB:(NSData *)data
if (shortBlue != nil)
free(shortBlue);
//NSLog(@"end palette conversion end length: %d", [rgbData length]);
_pixelDepth = 8;

return rgbData;

}
@@ -3232,8 +3230,6 @@ - (void)convertToRGBColorspace{
[_dcmObject setAttributeValues:[NSMutableArray arrayWithObject:[NSNumber numberWithInt:7]] forName:@"HighBit"];

_samplesPerPixel = [[[_dcmObject attributeForTag:[DCMAttributeTag tagWithName:@"SamplesperPixel"]] value] intValue];

_pixelDepth = 8;
}

}

0 comments on commit de68480

Please sign in to comment.
You can’t perform that action at this time.