Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/06/23 13:02:36 $
- Version: $Revision: 1.52 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.53 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void gdcmDicomDir::CreateDicomDirChainedList(std::string path)
{
CallStartMethod();
-
gdcmDirList fileList(path,1); // gets recursively the file list
unsigned int count=0;
VectDocument list;
it!=fileList.end();
++it)
{
+ std::cout << "nom fichier " << it->c_str() << std::endl; //JPR
+
progress=(float)(count+1)/(float)fileList.size();
CallProgressMethod();
if(abort)
- break;
+ break;
header=new gdcmHeader(it->c_str());
- if(header->IsReadable())
+ if(!header) {
+ std::cout << "echec new Header " << it->c_str() << std::endl; // JPR
+ }
+ if(header->IsReadable()) {
list.push_back(header); // adds the file header to the chained list
+ std::cout << "readable : " <<it->c_str() << std::endl;
+ }
else
delete header;
count++;
+
}
// sorts Patient/Study/Serie/
std::sort(list.begin(),list.end(),gdcmDicomDir::HeaderLessThan);
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void gdcmDirList::Explore(std::string dirName,bool recursive)
{
std::string fileName;
-
NormalizePath(dirName);
#if defined(_MSC_VER) || (__CYGWIN__)
WIN32_FIND_DATA fileData;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/06/24 18:03:14 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
guint16 z=0;
guint16 shortLgr = lgr;
+
if (vr == "unkn") { // Unknown was 'written'
// deal with Little Endian
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,fp);
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/06/25 19:37:05 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
const unsigned int gdcmDocument::HEADER_LENGTH_TO_READ = 256;
// Refer to gdcmDocument::SetMaxSizeLoadEntry()
-const unsigned int gdcmDocument::MAX_SIZE_LOAD_ELEMENT_VALUE = 0x7fffffff;// 4096;
-
+const unsigned int gdcmDocument::MAX_SIZE_LOAD_ELEMENT_VALUE = 0x7fffffff;// 4096;//
const unsigned int gdcmDocument::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff;//64;
//-----------------------------------------------------------------------------
*/
bool gdcmDocument::IsReadable(void) {
if(Filetype==gdcmUnknown) {
+ //std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype
+ // << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR
dbg.Verbose(0, "gdcmDocument::IsReadable: wrong filetype");
return false;
}
- if(!tagHT.empty()<=0) {
+ if(tagHT.empty()) {
dbg.Verbose(0, "gdcmDocument::IsReadable: no tags in internal"
" hash table.");
return false;
SetEntryLengthByNumber(20, 0x0002, 0x0010);
}
+// TODO : move to gdcmHeader::Write
+// -----------------------------------------------------
+ // Bits Allocated
+ if ( GetEntryByNumber(0x0028,0x0100) == "12") {
+ SetEntryByNumber("16", 0x0028,0x0100);
+ }
+
+ // correct Pixel group Length if necessary
+
+ guint16 GrPixel = 0x7fe0;
+ guint16 NumPixel = 0x0010;
+
+ // TODO : create a gdcmHeader::Write method and move this part.
+ // (only gdcmHeader knows GrPixel, NumPixel)
+
+ int i_lgPix = GetEntryLengthByNumber(GrPixel, NumPixel);
+ if (i_lgPix != -2) { // no (GrPixel, NumPixel) element
+ char * dumm = new char[20];
+ sprintf(dumm ,"%d", i_lgPix+12);
+ std::string s_lgPix = dumm;
+ delete dumm;
+ ReplaceOrCreateByNumber(s_lgPix,GrPixel, 0x0000);
+ }
+
+ // Drop Palette Color, if necessary
+
+ // FIXME : Why is it always false ???
+
+ // std::cout << "entry 0x0028,0x0002 " << GetEntryByNumber(0x0028,0x0002).c_str() << std::endl;
+
+ /* if ( GetEntryByNumber(0x0028,0x0002).c_str() == "3" ) */{
+
+ // Drop 0028|1101, 0028|1102, 0028|1103
+ // Drop 0028|1201, 0028|1202, 0028|1203
+
+ gdcmDocEntry *e;
+ e=GetDocEntryByNumber(0x0028,0x01101);
+ if (e)
+ RemoveEntry(e);
+ e=GetDocEntryByNumber(0x0028,0x1102);
+ if (e)
+ RemoveEntry(e);
+ e=GetDocEntryByNumber(0x0028,0x1103);
+
+ if (e)
+ RemoveEntry(e);
+ e=GetDocEntryByNumber(0x0028,0x01201);
+ if (e)
+ RemoveEntry(e);
+ e=GetDocEntryByNumber(0x0028,0x1202);
+ if (e)
+ RemoveEntry(e);
+ e=GetDocEntryByNumber(0x0028,0x1203);
+ if (e)
+ RemoveEntry(e);
+ }
+
+// ----------- end move to gdcmHeader::Write -----------------
+
/**
* \todo rewrite later, if really usefull
* ('Group Length' element is optional in DICOM)
*
* --> Warning : un-updated odd groups lengthes can causes pb
- * --> (xmedcon breaks)
- * --> to be re- written with future org.
+ * --> (xmedcon breaker)
*
* if ( (filetype == ImplicitVR) || (filetype == ExplicitVR) )
* UpdateGroupLength(false,filetype);
* UpdateGroupLength(true,ACR);
*/
- gdcmElementSet::Write(fp,filetype);
+ gdcmElementSet::Write(fp,filetype); // This one is recursive
- // return true;
}
/**
NewDocEntry = ReadNextDocEntry( );
if (!NewDocEntry)
break;
-
+ // NewDocEntry->Print(); cout << endl; //JPR
vr = NewDocEntry->GetVR();
if (vr!="SQ")
{
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/06/25 17:48:45 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void SetMaxSizeLoadEntry(long);
void SetMaxSizePrintEntry(long);
-
// DocEntry related utilities
gdcmDocEntry *ReadNextDocEntry ();
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/06/23 09:30:22 $
- Version: $Revision: 1.169 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.170 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
bool gdcmHeader::IsReadable() {
if(!gdcmDocument::IsReadable()) {
+ //std::cout << "doc non Readable " << std::endl; //JPR
return false;
}
std::string res = GetEntryByNumber(0x0028, 0x0005);
Program: gdcm
Module: $RCSfile: gdcmHeader.h,v $
Language: C++
- Date: $Date: 2004/06/23 03:36:24 $
- Version: $Revision: 1.77 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.78 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
int GetPlanarConfiguration();
int GetPixelSize();
- int GetPixelSizeGetPixelType();
std::string GetPixelType();
size_t GetPixelOffset();
size_t GetPixelAreaLength();
#define BITS_IN_JSAMPLE 8
-#define GDCM_jpr_DEBUG 0
-
/*
DICOM provides a mechanism for supporting the use of JPEG Image Compression
through the Encapsulated Format (see PS 3.3 of the DICOM Standard).
//-----------------------------------------------------------------------------
struct my_error_mgr {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf setjmp_buffer; /* for return to caller */
+ struct jpeg_error_mgr pub; /* "public" fields */
+ jmp_buf setjmp_buffer; /* for return to caller */
};
//-----------------------------------------------------------------------------
struct jpeg_decompress_struct cinfo;
/* -------------- inside, we found :
- * JDIMENSION image_width; // input image width
- * JDIMENSION image_height; // input image height
- * int input_components; // nb of color components in input image
- * J_COLOR_SPACE in_color_space; // colorspace of input image
- * double input_gamma; // image gamma of input image
+ * JDIMENSION image_width; // input image width
+ * JDIMENSION image_height; // input image height
+ * int input_components; // nb of color components in input image
+ * J_COLOR_SPACE in_color_space; // colorspace of input image
+ * double input_gamma; // image gamma of input image
* -------------- */
/* We use our private extension JPEG error handler.
struct my_error_mgr jerr;
/* More stuff */
- JSAMPARRAY buffer; /* Output row buffer */
+ JSAMPARRAY buffer;/* Output row buffer */
// rappel :
// ------
// typedef unsigned char JSAMPLE;
- // typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
- // typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
- // typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
+ // typedef JSAMPLE FAR *JSAMPROW;/* ptr to one image row of pixel samples. */
+ // typedef JSAMPROW *JSAMPARRAY;/* ptr to some rows (a 2-D sample array) */
+ // typedef JSAMPARRAY *JSAMPIMAGE;/* a 3-D sample array: top index is color */
- int row_stride; /* physical row width in output buffer */
+ int row_stride;/* physical row width in output buffer */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("entree dans gdcmFile::gdcm_read_JPEG_file12, depuis gdcmJpeg\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* In this example we want to open the input file before doing anything else,
* so that the setjmp() error recovery below can assume the file is open.
*/
/* Step 1: allocate and initialize JPEG decompression object */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 1\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* We set up the normal JPEG error routines, then override error_exit. */
jpeg_create_decompress(&cinfo);
/* Step 2: specify data source (eg, a file) */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 2\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
jpeg_stdio_src(&cinfo, fp);
/* Step 3: read file parameters with jpeg_read_header() */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 3\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_read_header(&cinfo, TRUE);
* See libjpeg.doc for more info.
*/
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("--------------Header contents :----------------\n");
printf("image_width %d image_height %d\n",
cinfo.image_width , cinfo.image_height);
cinfo.output_components);
printf("nb of color components returned %d \n",
cinfo.data_precision);
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/*
- * JDIMENSION image_width; // input image width
- * JDIMENSION image_height; // input image height
- * int output_components; // # of color components returned
- * J_COLOR_SPACE in_color_space; // colorspace of input image
- * double input_gamma; // image gamma of input image
- * int data_precision; // bits of precision in image data
+ * JDIMENSION image_width; // input image width
+ * JDIMENSION image_height; // input image height
+ * int output_components; // # of color components returned
+ * J_COLOR_SPACE in_color_space; // colorspace of input image
+ * double input_gamma; // image gamma of input image
+ * int data_precision; // bits of precision in image data
*/
/* Step 4: set parameters for decompression */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 4\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* In this example, we don't need to change any of the defaults set by
* jpeg_read_header(), so we do nothing here.
*/
/* Step 5: Start decompressor */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 5\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_start_decompress(&cinfo);
/* We can ignore the return value since suspension is not possible
/* JSAMPLEs per row in output buffer */
row_stride = cinfo.output_width * cinfo.output_components;
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf ("cinfo.output_width %d cinfo.output_components %d row_stride %d\n",
cinfo.output_width, cinfo.output_components,row_stride);
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* Make a one-row-high sample array that will go away when done with image */
buffer = (*cinfo.mem->alloc_sarray)
((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
/* Step 6: while (scan lines remain to be read) */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 6\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* jpeg_read_scanlines(...); */
/* Here we use the library's state variable cinfo.output_scanline as the
* loop counter, so that we don't have to keep track ourselves.
*/
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf ("cinfo.output_height %d cinfo.output_width %d\n",
cinfo.output_height,cinfo.output_width);
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
pimage=(char *)image_buffer;
while (cinfo.output_scanline < cinfo.output_height) {
}
/* Step 7: Finish decompression */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 7\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_finish_decompress(&cinfo);
/* Step 8: Release JPEG decompression object */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 8\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* This is an important step since it will release a good deal of memory. */
* temporary files are deleted if the program is interrupted. See libjpeg.doc.
*/
-//-----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
#define BITS_IN_JSAMPLE 12
-#define GDCM_jpr_DEBUG 0
// BITS_IN_JSAMPLE is a compile time defined options.
// We need both 8 an 12;
// To avoid renaming *all* the Jpeg functions,
// For all the functions, we shall have the 8 and 12 version
// (8 with the 'long' name, 12 with the 'short' name)
-#define jpeg_read_header jReadHeader
+#define jpeg_read_header jReadHeader
#define my_error_exit myErrorExit
-#define jpeg_destroy_decompress jDestDecompress
-#define jpeg_stdio_src jStdSrc
-#define jpeg_read_header jReadHeader
-#define jpeg_read_scanlines jReadScanlines
-#define jpeg_finish_decompress jFinDecompress
+#define jpeg_destroy_decompress jDestDecompress
+#define jpeg_stdio_src jStdSrc
+#define jpeg_read_header jReadHeader
+#define jpeg_read_scanlines jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
//#define jpeg_create_decompress jCreaDecompress //FIXME
// -----------------
-#define jpeg_std_error jStdError
-#define jpeg_CreateCompress jCreaCompress
-#define jpeg_CreateDecompress jCreaDecompress
-#define jpeg_destroy_compress jDestCompress
-#define jpeg_destroy_decompress jDestDecompress
-#define jpeg_stdio_dest jStdDest
-#define jpeg_stdio_src jStdSrc
-#define jpeg_set_defaults jSetDefaults
-#define jpeg_set_colorspace jSetColorspace
-#define jpeg_default_colorspace jDefColorspace
-#define jpeg_set_quality jSetQuality
-#define jpeg_set_linear_quality jSetLQuality
-#define jpeg_add_quant_table jAddQuantTable
-#define jpeg_quality_scaling jQualityScaling
-#define jpeg_simple_progression jSimProgress
-#define jpeg_suppress_tables jSuppressTables
-#define jpeg_alloc_quant_table jAlcQTable
-#define jpeg_alloc_huff_table jAlcHTable
-#define jpeg_start_compress jStrtCompress
-#define jpeg_write_scanlines jWrtScanlines
-#define jpeg_finish_compress jFinCompress
-#define jpeg_write_raw_data jWrtRawData
-#define jpeg_write_marker jWrtMarker
-#define jpeg_write_m_header jWrtMHeader
-#define jpeg_write_m_byte jWrtMByte
-#define jpeg_write_tables jWrtTables
-#define jpeg_read_header jReadHeader
-#define jpeg_start_decompress jStrtDecompress
-#define jpeg_read_scanlines jReadScanlines
-#define jpeg_finish_decompress jFinDecompress
-#define jpeg_read_raw_data jReadRawData
-#define jpeg_has_multiple_scans jHasMultScn
-#define jpeg_start_output jStrtOutput
-#define jpeg_finish_output jFinOutput
-#define jpeg_input_complete jInComplete
-#define jpeg_new_colormap jNewCMap
-#define jpeg_consume_input jConsumeInput
-#define jpeg_calc_output_dimensions jCalcDimensions
-#define jpeg_save_markers jSaveMarkers
-#define jpeg_set_marker_processor jSetMarker
-#define jpeg_read_coefficients jReadCoefs
-#define jpeg_write_coefficients jWrtCoefs
-#define jpeg_copy_critical_parameters jCopyCrit
-#define jpeg_abort_compress jAbrtCompress
-#define jpeg_abort_decompress jAbrtDecompress
-#define jpeg_abort jAbort
-#define jpeg_destroy jDestroy
-#define jpeg_resync_to_restart jResyncRestart
+#define jpeg_std_error jStdError
+#define jpeg_CreateCompress jCreaCompress
+#define jpeg_CreateDecompress jCreaDecompress
+#define jpeg_destroy_compress jDestCompress
+#define jpeg_destroy_decompress jDestDecompress
+#define jpeg_stdio_dest jStdDest
+#define jpeg_stdio_src jStdSrc
+#define jpeg_set_defaults jSetDefaults
+#define jpeg_set_colorspace jSetColorspace
+#define jpeg_default_colorspace jDefColorspace
+#define jpeg_set_quality jSetQuality
+#define jpeg_set_linear_quality jSetLQuality
+#define jpeg_add_quant_table jAddQuantTable
+#define jpeg_quality_scaling jQualityScaling
+#define jpeg_simple_progression jSimProgress
+#define jpeg_suppress_tables jSuppressTables
+#define jpeg_alloc_quant_table jAlcQTable
+#define jpeg_alloc_huff_table jAlcHTable
+#define jpeg_start_compress jStrtCompress
+#define jpeg_write_scanlines jWrtScanlines
+#define jpeg_finish_compress jFinCompress
+#define jpeg_write_raw_data jWrtRawData
+#define jpeg_write_marker jWrtMarker
+#define jpeg_write_m_header jWrtMHeader
+#define jpeg_write_m_byte jWrtMByte
+#define jpeg_write_tables jWrtTables
+#define jpeg_read_header jReadHeader
+#define jpeg_start_decompress jStrtDecompress
+#define jpeg_read_scanlines jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
+#define jpeg_read_raw_data jReadRawData
+#define jpeg_has_multiple_scans jHasMultScn
+#define jpeg_start_output jStrtOutput
+#define jpeg_finish_output jFinOutput
+#define jpeg_input_complete jInComplete
+#define jpeg_new_colormap jNewCMap
+#define jpeg_consume_input jConsumeInput
+#define jpeg_calc_output_dimensions jCalcDimensions
+#define jpeg_save_markers jSaveMarkers
+#define jpeg_set_marker_processor jSetMarker
+#define jpeg_read_coefficients jReadCoefs
+#define jpeg_write_coefficients jWrtCoefs
+#define jpeg_copy_critical_parameters jCopyCrit
+#define jpeg_abort_compress jAbrtCompress
+#define jpeg_abort_decompress jAbrtDecompress
+#define jpeg_abort jAbort
+#define jpeg_destroy jDestroy
+#define jpeg_resync_to_restart jResyncRestart
/*
* <setjmp.h> is used for the optional error recovery mechanism shown in
//-----------------------------------------------------------------------------
struct my_error_mgr {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf setjmp_buffer; /* for return to caller */
+ struct jpeg_error_mgr pub; /* "public" fields */
+ jmp_buf setjmp_buffer; /* for return to caller */
};
//-----------------------------------------------------------------------------
struct jpeg_decompress_struct cinfo;
/* -------------- inside, we found :
- * JDIMENSION image_width; // input image width
- * JDIMENSION image_height; // input image height
- * int input_components; // nb of color components in input image
- * J_COLOR_SPACE in_color_space; // colorspace of input image
- * double input_gamma; // image gamma of input image
+ * JDIMENSION image_width; // input image width
+ * JDIMENSION image_height; // input image height
+ * int input_components; // nb of color components in input image
+ * J_COLOR_SPACE in_color_space;// colorspace of input image
+ * double input_gamma; // image gamma of input image
* -------------- */
/* We use our private extension JPEG error handler.
struct my_error_mgr jerr;
/* More stuff */
- JSAMPARRAY buffer; /* Output row buffer */
+ JSAMPARRAY buffer;/* Output row buffer */
// rappel :
// ------
// typedef unsigned char JSAMPLE;
- // typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
- // typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
- // typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
+ // typedef JSAMPLE FAR *JSAMPROW;/* ptr to one image row of pixel samples. */
+ // typedef JSAMPROW *JSAMPARRAY;/* ptr to some rows (a 2-D sample array) */
+ // typedef JSAMPARRAY *JSAMPIMAGE;/* a 3-D sample array: top index is color */
- int row_stride; /* physical row width in output buffer */
-#ifdef GDCM_jpr_DEBUG
+ int row_stride;/* physical row width in output buffer */
+#ifdef GDCM_JPG_DEBUG
printf("entree dans gdcmFile::gdcm_read_JPEG_file12, depuis gdcmJpeg\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* In this example we want to open the input file before doing anything else,
* so that the setjmp() error recovery below can assume the file is open.
*/
/* Step 1: allocate and initialize JPEG decompression object */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 1\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* We set up the normal JPEG error routines, then override error_exit. */
jpeg_create_decompress(&cinfo);
/* Step 2: specify data source (eg, a file) */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 2\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
jpeg_stdio_src(&cinfo, fp);
/* Step 3: read file parameters with jpeg_read_header() */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 3\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_read_header(&cinfo, TRUE);
/* We can ignore the return value from jpeg_read_header since
* See libjpeg.doc for more info.
*/
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("--------------Header contents :----------------\n");
printf("image_width %d image_height %d\n",
cinfo.image_width , cinfo.image_height);
cinfo.output_components);
printf("nb of color components returned %d \n",
cinfo.data_precision);
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/*
- * JDIMENSION image_width; // input image width
- * JDIMENSION image_height; // input image height
- * int output_components; // # of color components returned
- * J_COLOR_SPACE in_color_space; // colorspace of input image
- * double input_gamma; // image gamma of input image
- * int data_precision; // bits of precision in image data
+ * JDIMENSION image_width; // input image width
+ * JDIMENSION image_height; // input image height
+ * int output_components; // # of color components returned
+ * J_COLOR_SPACE in_color_space; // colorspace of input image
+ * double input_gamma; // image gamma of input image
+ * int data_precision; // bits of precision in image data
*/
/* Step 4: set parameters for decompression */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 4\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* In this example, we don't need to change any of the defaults set by
* jpeg_read_header(), so we do nothing here.
*/
/* Step 5: Start decompressor */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 5\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_start_decompress(&cinfo);
/* We can ignore the return value since suspension is not possible
/* JSAMPLEs per row in output buffer */
row_stride = cinfo.output_width * cinfo.output_components;
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf ("cinfo.output_width %d cinfo.output_components %d row_stride %d\n",
cinfo.output_width, cinfo.output_components,row_stride);
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* Make a one-row-high sample array that will go away when done with image */
buffer = (*cinfo.mem->alloc_sarray)
- ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
+ ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
/* Step 6: while (scan lines remain to be read) */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 6\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* jpeg_read_scanlines(...); */
* loop counter, so that we don't have to keep track ourselves.
*/
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf ("cinfo.output_height %d cinfo.output_width %d\n",
- cinfo.output_height,cinfo.output_width);
-#endif //GDCM_jpr_DEBUG
+ cinfo.output_height,cinfo.output_width);
+#endif //GDCM_JPG_DEBUG
pimage=(char *)image_buffer;
}
/* Step 7: Finish decompression */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 7\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
(void) jpeg_finish_decompress(&cinfo);
/* We can ignore the return value since suspension is not possible
* with the stdio data source.
*/
/* Step 8: Release JPEG decompression object */
-#ifdef GDCM_jpr_DEBUG
+#ifdef GDCM_JPG_DEBUG
printf("Entree Step 8\n");
-#endif //GDCM_jpr_DEBUG
+#endif //GDCM_JPG_DEBUG
/* This is an important step since it will release a good deal of memory. */
jpeg_destroy_decompress(&cinfo);
*/
bool gdcmFile::gdcm_read_JPEG2000_file (FILE *fp,void * image_buffer) {
- (void)fp; //FIXME
- (void)image_buffer; //FIXME
+ (void)fp; //FIXME
+ (void)image_buffer; //FIXME
printf("Sorry JPEG 2000 File not yet taken into account\n");
return false;
}
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:48 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2004/06/28 09:30:58 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
tested == "UI" || tested == "TM" || tested == "SH" || tested == "LO" ||
tested == "CS" || tested == "IS" || tested == "LO" || tested == "LT" ||
tested == "SH" || tested == "ST" || tested == "DS" || tested == "SL" ||
- tested == "SS" || tested == "UL" || tested == "US" )
+ tested == "SS" || tested == "UL" || tested == "US" || tested == "UN")
{
return true;
}