/**
* \ingroup gdcmFile
* \brief canonical destructor
- * \Note If the gdcmHeader is created by the gdcmFile, it is destroyed
+ * \note If the gdcmHeader is created by the gdcmFile, it is destroyed
* by the gdcmFile
*/
gdcmFile::~gdcmFile(void) {
// Public
/**
* \ingroup gdcmFile
- * \brief
+ * \brief returns the gdcmHeader *Header
* @return
*/
gdcmHeader *gdcmFile::GetHeader(void) {
PixelData = (void *) malloc(lgrTotale);
if (PixelData)
GetImageDataIntoVector(PixelData, lgrTotale);
+
PixelRead=0; // no PixelRaw
return(PixelData);
}
}
(void)ReadPixelData(destination);
-
+
// Number of Bits Allocated for storing a Pixel
str_nb = Header->GetEntryByNumber(0x0028,0x0100);
if (str_nb == GDCM_UNFOUND ) {
deb++;
}
}
-
// re arange bits inside the bytes
if (nbu != nb){
int l = (int)lgrTotale / (nb/8);
return (size_t)0;
}
}
-// DO NOT remove this code commented out.
+// DO NOT remove this commented out code .
// Nobody knows what's expecting you ...
// Just to 'see' what was actually read on disk :-(
/**
* \ingroup gdcmFile
- * \brief TODO JPR
- * \warning doit-etre etre publique ?
- * \toto : y a-t-il un inconvenient à fusioner ces 2 fonctions
- *
- * @param inData
- * @param ExpectedSize
+ * \brief performs a shadow copy (not a deep copy) of the user given
+ * pixel area.
+ * 'image' Pixels are presented as C-like 2D arrays : line per line.
+ * 'volume'Pixels are presented as C-like 3D arrays : lane per plane
+ * \warning user is kindly requested NOT TO 'free' the Pixel area
+ * @param inData user supplied pixel area
+ * @param ExpectedSize total image size, in Bytes
*
* @return boolean
*/
/**
* \ingroup gdcmFile
- * \brief Writes on disk A SINGLE Dicom file
+ * \brief Writes on disk A SINGLE Dicom file,
+ * using the Implicit Value Representation convention
* NO test is performed on processor "Endiannity".
* @param fileName name of the file to be created
* (any already existing file is overwritten)
/**
* \ingroup gdcmFile
- * \brief
- * @param fileName name of the file to be created
+ * \brief Writes on disk A SINGLE Dicom file,
+ * using the Implicit Value Representation convention
+ * NO test is performed on processor "Endiannity". * @param fileName name of the file to be created
* (any already existing file is overwritten)
* @return false if write fails
*/
/**
* \ingroup gdcmFile
- * \brief
- * @param fileName name of the file to be created
+* \brief Writes on disk A SINGLE Dicom file,
+ * using the Explicit Value Representation convention
+ * NO test is performed on processor "Endiannity". * @param fileName name of the file to be created
* (any already existing file is overwritten)
* @return false if write fails
*/
/**
* \ingroup gdcmFile
- * \brief Ecrit au format ACR-NEMA sur disque l'entete et les pixels
+ * \brief Writes on disk A SINGLE Dicom file,
+ * using the ACR-NEMA convention
+ * NO test is performed on processor "Endiannity".
* (a l'attention des logiciels cliniques
* qui ne prennent en entrée QUE des images ACR ...
* \warning if a DICOM_V3 header is supplied,
- * groups < 0x0008 and shadow groups are ignored)
+ * groups < 0x0008 and shadow groups are ignored
* \warning NO TEST is performed on processor "Endiannity".
- * Ca fonctionnera correctement (?) sur processeur Intel
- * (Equivalent a IdDcmWrite)
- *
* @param fileName name of the file to be created
* (any already existing file is overwritten)
* @return false if write fails
// Protected
/**
* \ingroup gdcmFile
- *
+ * \brief NOT a end user inteded function
+ * (used by WriteDcmExplVR, WriteDcmImplVR, WriteAcr, etc)
* @param fileName name of the file to be created
* (any already existing file is overwritten)
- * @param type file type (ExplicitVR, ImplicitVR, ...)
+ * @param type file type (ExplicitVR, ImplicitVR, DICOMDIR, ...)
* @return false if write fails
*/
bool gdcmFile::WriteBase (std::string fileName, FileType type) {
FILE * fp1;
if (PixelRead==-1 && type != DICOMDIR) {
- std::cout << "U never Read the pixels; U cannot write the file"
- << std::endl;
+/* std::cout << "U never Read the pixels; U cannot write the file"
+ << std::endl;*/
return false;
}
case 2143:
case 4321:
- for(i=0;i<lgr;i++)
+ for(i=0;i<lgr/2;i++) {
((unsigned short int*)im)[i]= ((((unsigned short int*)im)[i])>>8)
| ((((unsigned short int*)im)[i])<<8);
+ }
break;
default:
break;
case 4321:
- for(i=0;i<lgr;i++) {
+ for(i=0;i<lgr/4;i++) {
faible= ((unsigned long int*)im)[i]&0x0000ffff; /* 4321 */
fort =((unsigned long int*)im)[i]>>16;
fort= (fort>>8) | (fort<<8);
break;
case 2143:
- for(i=0;i<lgr;i++) {
+ for(i=0;i<lgr/4;i++) {
faible= ((unsigned long int*)im)[i]&0x0000ffff; /* 2143 */
fort=((unsigned long int*)im)[i]>>16;
fort= (fort>>8) | (fort<<8);
break;
case 3412:
- for(i=0;i<lgr;i++) {
+ for(i=0;i<lgr/4;i++) {
faible= ((unsigned long int*)im)[i]&0x0000ffff; /* 3412 */
fort=((unsigned long int*)im)[i]>>16;
s32=faible;