Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" ",
" mode = a (ACR), x (Explicit VR Dicom), r (RAW : only pixels) ",
" j (jpeg lossless), 2 (jpeg2000) ",
" ",
" mode = a (ACR), x (Explicit VR Dicom), r (RAW : only pixels) ",
" j (jpeg lossless), 2 (jpeg2000) ",
" keepoverlays : user wants to keep ACR-NEMA-like overlays ",
" monochrome1 = user wants MONOCHROME1 photom. interp. (0=white) ",
" noshadowseq: user doesn't want to load Private Sequences ",
" keepoverlays : user wants to keep ACR-NEMA-like overlays ",
" monochrome1 = user wants MONOCHROME1 photom. interp. (0=white) ",
" noshadowseq: user doesn't want to load Private Sequences ",
// ----------- End Arguments Manager ---------
GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
// ----------- End Arguments Manager ---------
GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
// from a full gdcm readable File
std::cout << "WriteDCM Jpeg Lossless" << std::endl;
fh->SetWriteTypeToJPEG();
break;
case '2' :
// from a full gdcm readable File
std::cout << "WriteDCM Jpeg Lossless" << std::endl;
fh->SetWriteTypeToJPEG();
break;
case '2' :
// from a full gdcm readable File
std::cout << "WriteDCM Jpeg 2000" << std::endl;
fh->SetWriteTypeToJPEG2000();
// from a full gdcm readable File
std::cout << "WriteDCM Jpeg 2000" << std::endl;
fh->SetWriteTypeToJPEG2000();
//
// user wants to keep only a part of the image (ROI, and/or some frames)
// ---------------------------------------------------------------------
// (==> this is no longer really 'ReWrite' !)
int subImDimX = nX;
//
// user wants to keep only a part of the image (ROI, and/or some frames)
// ---------------------------------------------------------------------
// (==> this is no longer really 'ReWrite' !)
int subImDimX = nX;
if (roiBoundVal[0]<0 || roiBoundVal[0]>=nX)
{
std::cout << "xBegin out of bounds; 'roi' ignored" << std::endl;
if (roiBoundVal[0]<0 || roiBoundVal[0]>=nX)
{
std::cout << "xBegin out of bounds; 'roi' ignored" << std::endl;
if (roiBoundVal[0] > roiBoundVal[1])
{
std::cout << "xBegin greater than xEnd; 'roi' ignored" << std::endl;
if (roiBoundVal[0] > roiBoundVal[1])
{
std::cout << "xBegin greater than xEnd; 'roi' ignored" << std::endl;
// Set the data that will be *actually* written.
int pixelSize = fh->GetFile()->GetPixelSize();
size_t lgrSubLine = subImDimX* pixelSize * numberOfScalarComponents;
size_t lgrSubFrame = subImDimY*lgrSubLine;
// Set the data that will be *actually* written.
int pixelSize = fh->GetFile()->GetPixelSize();
size_t lgrSubLine = subImDimX* pixelSize * numberOfScalarComponents;
size_t lgrSubFrame = subImDimY*lgrSubLine;
uint8_t * srcCopy = (uint8_t *) imageData;
uint8_t * destCopy = subImage;
int lineSize = nX*pixelSize*numberOfScalarComponents;
uint8_t * srcCopy = (uint8_t *) imageData;
uint8_t * destCopy = subImage;
int lineSize = nX*pixelSize*numberOfScalarComponents;
memcpy( (void *)(destCopy + frameCount*lgrSubFrame + lineCount*lgrSubLine),
(void *)(srcCopy + frameNb*frameSize + lineNb*lineSize + lineOffset ),
lgrSubLine);
memcpy( (void *)(destCopy + frameCount*lgrSubFrame + lineCount*lgrSubLine),
(void *)(srcCopy + frameNb*frameSize + lineNb*lineSize + lineOffset ),
lgrSubLine);
//----------------------------------- Write, now! ---------------------------------
if (mode[0] != 'R' && mode[0] != 'r')
//----------------------------------- Write, now! ---------------------------------
if (mode[0] != 'R' && mode[0] != 'r')