I use a class derived from DiPluginFormat to act as a bridge between my application and DICOM images. I'm trying to read a bunch of 16-bit signed velocity-encoded MRI images, where the pixel values vary e.g. from -100 to 100. If I read these with DiImage::getOutputData(), the pixel values become what I gather to be two's complements of what they are supposed to be (they map to the range -32768 ... -32668, 32668 ... 32767).
Code: Select all
int myplugin::write(
DiImage* image,
FILE* stream,
const unsigned long frame) const
{
int StoredBits = image->getBits();
const void * data = image->getOutputData(0, StoredBits, 0);
// do stuff with data
return 1;
}
- Marko