OD_VALUE_STREAM_CLASS::OD_VALUE_STREAM_CLASS() // DESCRIPTION : Constructor. // PRECONDITIONS : // POSTCONDITIONS : // EXCEPTIONS : // NOTES : //<<=========================================================================== { // constructor activities Initialise(); bits_allocatedM = 32; file_vrM = GetVR(); }
void OTHER_VALUE_STREAM_CLASS::GenerateFilename() // DESCRIPTION : Function to generate a filename for storing Other data. // PRECONDITIONS : // POSTCONDITIONS : // EXCEPTIONS : // NOTES : //<<=========================================================================== { char filename[32]; string storage_root; unsigned long pixel_index = 1; ATTR_VR_ENUM vr = GetVR(); if (loggerM_ptr) { // get the storage root and pixel index storage_root = loggerM_ptr->getStorageRoot(); pixel_index = getPixIndex(storage_root); } else { pixel_index = uniq8odd(); } // generate a filename for the image pixel data if (vr == ATTR_VR_OB) { if (bits_allocatedM == 8) { if (fs_codeM & TS_COMPRESSED) { sprintf(filename, "B08C%04d.pix", pixel_index); } else { sprintf(filename, "B08_%04d.pix", pixel_index); } } else if (bits_allocatedM == 16) { if (fs_codeM & TS_COMPRESSED) { sprintf(filename, "B16C%04d.pix", pixel_index); } else { sprintf(filename, "B16_%04d.pix", pixel_index); } } else { sprintf(filename, "%08d.pix", pixel_index); } } else if (vr == ATTR_VR_OF) { if (fs_codeM & TS_BIG_ENDIAN) { sprintf(filename, "F32B%04d.pix", pixel_index); } else { sprintf(filename, "F32L%04d.pix", pixel_index); } } else if (vr == ATTR_VR_OW) { if (bits_allocatedM == 8) { if (fs_codeM & TS_BIG_ENDIAN) { sprintf(filename, "W08B%04d.pix", pixel_index); } else { sprintf(filename, "W08L%04d.pix", pixel_index); } } else if (bits_allocatedM == 16) { if (fs_codeM & TS_BIG_ENDIAN) { sprintf(filename, "W16B%04d.pix", pixel_index); } else { sprintf(filename, "W16L%04d.pix", pixel_index); } } else { sprintf(filename, "%08d.pix", pixel_index); } } else { sprintf(filename, "%08d.pix", pixel_index); } // see if a data file root is defined if (loggerM_ptr) { // see if the storage root has been defined if (storage_root.length()) { // set up filename by including path filenameM = storage_root; if (storage_root[storage_root.length()-1] != '\\') filenameM += "\\"; filenameM += filename; } else { // local filename filenameM = filename; } } else { // local filename filenameM = filename; } }