80 : DATABUFFSIZE(8192), LINEBUFFSIZE(5020), FILENAMESIZE(512),
81 fCompression(0), fNFiles(0), fRows(0), fColumns(0),
82 fBitAllocated(0), fMaxPixelValue(0), fMinPixelValue(0),
83 fPixelSpacingX(0.), fPixelSpacingY(0.),
84 fSliceThickness(0.), fSliceLocation(0.),
85 fRescaleIntercept(0), fRescaleSlope(0),
86 fLittleEndian(true), fImplicitEndian(false),
87 fPixelRepresentation(0), nbrequali(0),
88 valuedensity(NULL),valueCT(NULL),readCalibration(false),
89 mergedSlices(NULL),driverFile(
"Data.dat"),ct2densityFile(
"CT2Density.dat")
107 G4int returnvalue = 0;
size_t rflag = 0;
108 char *
buffer =
new char[LINEBUFFSIZE];
110 fImplicitEndian =
false;
111 fLittleEndian =
true;
113 rflag = std::fread( buffer, 1, 128, dicom );
116 rflag = std::fread( buffer, 1, 4, dicom );
118 if(std::strncmp(
"DICM", buffer, 4) != 0) {
119 std::fseek(dicom, 0, SEEK_SET);
120 fImplicitEndian =
true;
125 short elementLength2;
127 unsigned long elementLength4;
129 char *
data =
new char[DATABUFFSIZE];
139 rflag = std::fread(buffer, 2, 1, dicom);
140 GetValue(buffer, readGroupId);
142 rflag = std::fread(buffer, 2, 1, dicom);
143 GetValue(buffer, readElementId);
146 G4int tagDictionary = readGroupId*0x10000 + readElementId;
149 if(tagDictionary == 0x7FE00010) {
151 rflag = std::fread(buffer,2,1,dicom);
152 rflag = std::fread(buffer,4,1,dicom);
157 rflag = std::fread(buffer,2,1,dicom);
158 GetValue(buffer, elementLength2);
162 if((elementLength2 == 0x424f ||
163 elementLength2 == 0x574f ||
164 elementLength2 == 0x464f ||
165 elementLength2 == 0x5455 ||
166 elementLength2 == 0x5153 ||
167 elementLength2 == 0x4e55) &&
170 rflag = std::fread(buffer, 2, 1, dicom);
173 rflag = std::fread(buffer, 4, 1, dicom);
174 GetValue(buffer, elementLength4);
176 if(elementLength2 == 0x5153)
178 if(elementLength4 == 0xFFFFFFFF)
180 read_undefined_nested( dicom );
183 if(read_defined_nested( dicom, elementLength4 )==0){
184 G4cerr <<
"Function read_defined_nested() failed!" <<
G4endl;
189 rflag = std::fread(data, elementLength4,1,dicom);
196 if(!fImplicitEndian || readGroupId == 2) {
200 rflag = std::fread(buffer, 2, 1, dicom);
201 GetValue(buffer, elementLength2);
202 elementLength4 = elementLength2;
204 rflag = std::fread(data, elementLength4, 1, dicom);
211 if(std::fseek(dicom, -2, SEEK_CUR) != 0) {
215 rflag = std::fread(buffer, 4, 1, dicom);
216 GetValue(buffer, elementLength4);
220 if(elementLength4 == 0xFFFFFFFF)
222 read_undefined_nested(dicom);
225 rflag = std::fread(data, elementLength4, 1, dicom);
232 data[elementLength4] =
'\0';
235 GetInformation(tagDictionary, data);
243 std::map<G4float,G4String>::const_iterator ite;
244 for( ite = fMaterialIndices.begin(); ite != fMaterialIndices.end(); ++ite ){
252 zslice->
SetMinX(-fPixelSpacingX*fColumns/2.);
253 zslice->
SetMaxX(fPixelSpacingX*fColumns/2.);
255 zslice->
SetMinY(-fPixelSpacingY*fRows/2.);
256 zslice->
SetMaxY(fPixelSpacingY*fRows/2.);
258 zslice->
SetMinZ(fSliceLocation-fSliceThickness/2.);
259 zslice->
SetMaxZ(fSliceLocation+fSliceThickness/2.);
304 if (rflag)
return returnvalue;
310 void DicomHandler::GetInformation(
G4int & tagDictionary,
char *
data)
312 if(tagDictionary == 0x00280010 ) {
313 GetValue(data, fRows);
316 }
else if(tagDictionary == 0x00280011 ) {
317 GetValue(data, fColumns);
318 std::printf(
"[0x00280011] Columns -> %i\n",fColumns);
320 }
else if(tagDictionary == 0x00280102 ) {
322 GetValue(data, highBits);
323 std::printf(
"[0x00280102] High bits -> %i\n",highBits);
325 }
else if(tagDictionary == 0x00280100 ) {
326 GetValue(data, fBitAllocated);
327 std::printf(
"[0x00280100] Bits allocated -> %i\n", fBitAllocated);
329 }
else if(tagDictionary == 0x00280101 ) {
331 GetValue(data, bitStored);
332 std::printf(
"[0x00280101] Bits stored -> %i\n",bitStored);
334 }
else if(tagDictionary == 0x00280106 ) {
335 GetValue(data, fMinPixelValue);
336 std::printf(
"[0x00280106] Min. pixel value -> %i\n", fMinPixelValue);
338 }
else if(tagDictionary == 0x00280107 ) {
339 GetValue(data, fMaxPixelValue);
340 std::printf(
"[0x00280107] Max. pixel value -> %i\n", fMaxPixelValue);
342 }
else if(tagDictionary == 0x00281053) {
343 fRescaleSlope = atoi(data);
344 std::printf(
"[0x00281053] Rescale Slope -> %d\n", fRescaleSlope);
346 }
else if(tagDictionary == 0x00281052 ) {
347 fRescaleIntercept = atoi(data);
348 std::printf(
"[0x00281052] Rescale Intercept -> %d\n", fRescaleIntercept );
350 }
else if(tagDictionary == 0x00280103 ) {
352 fPixelRepresentation = atoi(data);
353 std::printf(
"[0x00280103] Pixel Representation -> %i\n", fPixelRepresentation);
354 if(fPixelRepresentation == 1 ) {
355 std::printf(
"### PIXEL REPRESENTATION = 1, BITS ARE SIGNED, ");
356 std::printf(
"DICOM READING SCAN FOR UNSIGNED VALUE, POSSIBLE ");
360 }
else if(tagDictionary == 0x00080006 ) {
361 std::printf(
"[0x00080006] Modality -> %s\n", data);
363 }
else if(tagDictionary == 0x00080070 ) {
364 std::printf(
"[0x00080070] Manufacturer -> %s\n", data);
366 }
else if(tagDictionary == 0x00080080 ) {
367 std::printf(
"[0x00080080] Institution Name -> %s\n", data);
369 }
else if(tagDictionary == 0x00080081 ) {
370 std::printf(
"[0x00080081] Institution Address -> %s\n", data);
372 }
else if(tagDictionary == 0x00081040 ) {
373 std::printf(
"[0x00081040] Institution Department Name -> %s\n", data);
375 }
else if(tagDictionary == 0x00081090 ) {
376 std::printf(
"[0x00081090] Manufacturer's Model Name -> %s\n", data);
378 }
else if(tagDictionary == 0x00181000 ) {
379 std::printf(
"[0x00181000] Device Serial Number -> %s\n", data);
381 }
else if(tagDictionary == 0x00080008 ) {
382 std::printf(
"[0x00080008] Image Types -> %s\n", data);
384 }
else if(tagDictionary == 0x00283000 ) {
385 std::printf(
"[0x00283000] Modality LUT Sequence SQ 1 -> %s\n", data);
387 }
else if(tagDictionary == 0x00283002 ) {
388 std::printf(
"[0x00283002] LUT Descriptor US or SS 3 -> %s\n", data);
390 }
else if(tagDictionary == 0x00283003 ) {
391 std::printf(
"[0x00283003] LUT Explanation LO 1 -> %s\n", data);
393 }
else if(tagDictionary == 0x00283004 ) {
394 std::printf(
"[0x00283004] Modality LUT Type LO 1 -> %s\n", data);
396 }
else if(tagDictionary == 0x00283006 ) {
397 std::printf(
"[0x00283006] LUT Data US or SS -> %s\n", data);
399 }
else if(tagDictionary == 0x00283010 ) {
400 std::printf(
"[0x00283010] VOI LUT Sequence SQ 1 -> %s\n", data);
402 }
else if(tagDictionary == 0x00280120 ) {
403 std::printf(
"[0x00280120] Pixel Padding Value US or SS 1 -> %s\n", data);
405 }
else if(tagDictionary == 0x00280030 ) {
407 int iss = datas.find(
'\\');
408 fPixelSpacingX = atof( datas.substr(0,iss).c_str() );
409 fPixelSpacingY = atof( datas.substr(iss+2,datas.length()).c_str() );
411 }
else if(tagDictionary == 0x00200037 ) {
412 std::printf(
"[0x00200037] Image Orientation (Phantom) -> %s\n", data);
414 }
else if(tagDictionary == 0x00200032 ) {
415 std::printf(
"[0x00200032] Image Position (Phantom,mm) -> %s\n", data);
417 }
else if(tagDictionary == 0x00180050 ) {
418 fSliceThickness = atof(data);
419 std::printf(
"[0x00180050] Slice Thickness (mm) -> %f\n", fSliceThickness);
421 }
else if(tagDictionary == 0x00201041 ) {
422 fSliceLocation = atof(data);
423 std::printf(
"[0x00201041] Slice Location -> %f\n", fSliceLocation);
425 }
else if(tagDictionary == 0x00280004 ) {
426 std::printf(
"[0x00280004] Photometric Interpretation -> %s\n", data);
428 }
else if(tagDictionary == 0x00020010) {
429 if(strcmp(data,
"1.2.840.10008.1.2") == 0)
430 fImplicitEndian =
true;
431 else if(strncmp(data,
"1.2.840.10008.1.2.2", 19) == 0)
432 fLittleEndian =
false;
454 if(!dcmPZSH) {
return; }
459 if(fCompression == 1) {
460 for(
G4int ww = 0; ww < fRows; ww++) {
464 density = Pixel2density(mean);
466 dcmPZSH->
AddMateID(GetMaterialIndex(density));
473 for(
G4int ww = 0; ww < fRows ;ww += fCompression ) {
475 for(
G4int xx = 0;
xx < fColumns ;
xx +=fCompression ) {
478 for(
int sumx = 0; sumx < fCompression; sumx++) {
479 for(
int sumy = 0; sumy < fCompression; sumy++) {
480 if(ww+sumy >= fRows ||
xx+sumx >= fColumns) overflow =
true;
481 mean += fTab[ww+sumy][
xx+sumx];
485 mean /= fCompression*fCompression;
488 density = Pixel2density(mean);
490 dcmPZSH->
AddMateID(GetMaterialIndex(density));
501 void DicomHandler::StoreData(std::ofstream& foutG4DCM)
508 if(fCompression == 1) {
509 for(
G4int ww = 0; ww < fRows; ww++) {
512 density = Pixel2density(mean);
513 foutG4DCM << GetMaterialIndex( density ) <<
" ";
521 for(
G4int ww = 0; ww < fRows ;ww += fCompression ) {
522 for(
G4int xx = 0;
xx < fColumns ;
xx +=fCompression ) {
525 for(
int sumx = 0; sumx < fCompression; sumx++) {
526 for(
int sumy = 0; sumy < fCompression; sumy++) {
527 if(ww+sumy >= fRows ||
xx+sumx >= fColumns) overflow =
true;
528 mean += fTab[ww+sumy][
xx+sumx];
532 mean /= fCompression*fCompression;
535 density = Pixel2density(mean);
536 foutG4DCM << GetMaterialIndex( density ) <<
" ";
545 if(fCompression == 1) {
546 for(
G4int ww = 0; ww < fRows; ww++) {
549 density = Pixel2density(mean);
550 foutG4DCM << density <<
" ";
551 if(
xx%8 == 3 ) foutG4DCM <<
G4endl;
558 for(
G4int ww = 0; ww < fRows ;ww += fCompression ) {
559 for(
G4int xx = 0;
xx < fColumns ;
xx +=fCompression ) {
562 for(
int sumx = 0; sumx < fCompression; sumx++) {
563 for(
int sumy = 0; sumy < fCompression; sumy++) {
564 if(ww+sumy >= fRows ||
xx+sumx >= fColumns) overflow =
true;
565 mean += fTab[ww+sumy][
xx+sumx];
569 mean /= fCompression*fCompression;
572 density = Pixel2density(mean);
573 foutG4DCM << density <<
" ";
574 if(
xx/fCompression%8 == 3 ) foutG4DCM <<
G4endl;
585 void DicomHandler::ReadMaterialIndices( std::ifstream& finData)
591 if( finData.eof() )
return;
594 for(
unsigned int ii = 0; ii < nMate; ii++ ){
595 finData >> mateName >> densityMax;
596 fMaterialIndices[densityMax] = mateName;
597 G4cout << ii <<
" ReadMaterialIndices " << mateName <<
" " << densityMax <<
G4endl;
604 unsigned int DicomHandler::GetMaterialIndex(
G4float density )
606 std::map<G4float,G4String>::reverse_iterator ite;
607 G4int ii = fMaterialIndices.size();
608 for( ite = fMaterialIndices.rbegin(); ite != fMaterialIndices.rend(); ite++, ii-- ) {
609 if( density >= (*ite).first ) {
615 if(static_cast<unsigned int>(ii) == fMaterialIndices.size())
616 { ii = fMaterialIndices.size()-1; }
626 G4int returnvalue = 0;
size_t rflag = 0;
631 fTab =
new G4int*[fRows];
632 for (
G4int i = 0; i < fRows; i ++ ) {
633 fTab[i] =
new G4int[fColumns];
636 if(fBitAllocated == 8) {
642 unsigned char ch = 0;
644 for(
G4int j = 0; j < fRows; j++) {
645 for(
G4int i = 0; i < fColumns; i++) {
647 rflag = std::fread( &ch, 1, 1, dicom);
648 fTab[j][i] = ch*fRescaleSlope + fRescaleIntercept;
656 for(
G4int j = 0; j < fRows; j++) {
657 for(
G4int i = 0; i < fColumns; i++) {
659 rflag = std::fread(sbuff, 2, 1, dicom);
660 GetValue(sbuff, pixel);
661 fTab[j][i] = pixel*fRescaleSlope + fRescaleIntercept;
667 char * nameProcessed =
new char[FILENAMESIZE];
670 std::sprintf(nameProcessed,
"%s.g4dcmb",filename2);
671 fileOut = std::fopen(nameProcessed,
"w+b");
672 std::printf(
"### Writing of %s ###\n",nameProcessed);
674 unsigned int nMate = fMaterialIndices.size();
675 rflag = std::fwrite(&nMate,
sizeof(
unsigned int), 1, fileOut);
677 std::map<G4float,G4String>::const_iterator ite;
678 for( ite = fMaterialIndices.begin(); ite != fMaterialIndices.end(); ite++ ){
680 for(
G4int ii = (*ite).second.length(); ii < 40; ii++ ) {
684 const char* mateNameC = mateName.c_str();
685 rflag = std::fwrite(mateNameC,
sizeof(
char),40, fileOut);
688 unsigned int fRowsC = fRows/fCompression;
689 unsigned int fColumnsC = fColumns/fCompression;
690 unsigned int planesC = 1;
691 G4float pixelLocationXM = -fPixelSpacingX*fColumns/2.;
692 G4float pixelLocationXP = fPixelSpacingX*fColumns/2.;
693 G4float pixelLocationYM = -fPixelSpacingY*fRows/2.;
694 G4float pixelLocationYP = fPixelSpacingY*fRows/2.;
695 G4float fSliceLocationZM = fSliceLocation-fSliceThickness/2.;
696 G4float fSliceLocationZP = fSliceLocation+fSliceThickness/2.;
698 rflag = std::fwrite(&fRowsC,
sizeof(
unsigned int), 1, fileOut);
699 rflag = std::fwrite(&fColumnsC,
sizeof(
unsigned int), 1, fileOut);
700 rflag = std::fwrite(&planesC,
sizeof(
unsigned int), 1, fileOut);
702 rflag = std::fwrite(&pixelLocationXM,
sizeof(
G4float), 1, fileOut);
703 rflag = std::fwrite(&pixelLocationXP,
sizeof(
G4float), 1, fileOut);
704 rflag = std::fwrite(&pixelLocationYM,
sizeof(
G4float), 1, fileOut);
705 rflag = std::fwrite(&pixelLocationYP,
sizeof(
G4float), 1, fileOut);
706 rflag = std::fwrite(&fSliceLocationZM,
sizeof(
G4float), 1, fileOut);
707 rflag = std::fwrite(&fSliceLocationZP,
sizeof(
G4float), 1, fileOut);
711 std::printf(
"%8f %8f\n",fPixelSpacingX,fPixelSpacingY);
716 G4int compSize = fCompression;
723 for(
G4int ww = 0; ww < fRows; ww++) {
726 density = Pixel2density(mean);
727 unsigned int mateID = GetMaterialIndex( density );
728 rflag = std::fwrite(&mateID,
sizeof(
unsigned int), 1, fileOut);
735 for(
G4int ww = 0; ww < fRows ;ww += compSize ) {
739 for(
int sumx = 0; sumx < compSize; sumx++) {
740 for(
int sumy = 0; sumy < compSize; sumy++) {
741 if(ww+sumy >= fRows ||
xx+sumx >= fColumns) overflow =
true;
742 mean += fTab[ww+sumy][
xx+sumx];
746 mean /= compSize*compSize;
749 density = Pixel2density(mean);
750 unsigned int mateID = GetMaterialIndex( density );
751 rflag = std::fwrite(&mateID,
sizeof(
unsigned int), 1, fileOut);
760 for(
G4int ww = 0; ww < fRows; ww++) {
763 density = Pixel2density(mean);
764 rflag = std::fwrite(&density,
sizeof(
G4float), 1, fileOut);
771 for(
G4int ww = 0; ww < fRows ;ww += compSize ) {
775 for(
int sumx = 0; sumx < compSize; sumx++) {
776 for(
int sumy = 0; sumy < compSize; sumy++) {
777 if(ww+sumy >= fRows ||
xx+sumx >= fColumns) overflow =
true;
778 mean += fTab[ww+sumy][
xx+sumx];
782 mean /= compSize*compSize;
785 density = Pixel2density(mean);
786 rflag = std::fwrite(&density,
sizeof(
G4float), 1, fileOut);
795 delete [] nameProcessed;
803 if (rflag)
return returnvalue;
812 void DicomHandler::ReadCalibration()
818 std::ifstream calibration(ct2densityFile.c_str());
819 calibration >> nbrequali;
821 valuedensity =
new G4double[nbrequali];
825 G4cerr <<
"@@@ No value to transform pixels in density!" <<
G4endl;
829 for(
G4int i = 0; i < nbrequali; i++) {
830 calibration >> valueCT[i] >> valuedensity[i];
835 readCalibration =
true;
842 if(!readCalibration) { ReadCalibration(); }
849 for(
G4int j = 1; j < nbrequali; j++) {
850 if( pixel >= valueCT[j-1] && pixel < valueCT[j]) {
852 deltaCT = valueCT[j] - valueCT[j-1];
853 deltaDensity = valuedensity[j] - valuedensity[j-1];
856 density = valuedensity[j] - ((valueCT[j] - pixel)*deltaDensity/deltaCT );
862 std::printf(
"@@@ Error density = %f && Pixel = %i \
863 (0x%x) && deltaDensity/deltaCT = %f\n",density,pixel,pixel, deltaDensity/deltaCT);
873 std::ifstream checkData(driverFile.c_str());
874 char * oneLine =
new char[128];
876 if(!(checkData.is_open())) {
878 G4cout <<
"\nDicomG4 needs Data.dat (or another driver file specified in command line)"
879 <<
":\n\tFirst line: number of image pixel for a "
880 <<
"voxel (G4Box)\n\tSecond line: number of images (CT slices) to "
881 <<
"read\n\tEach following line contains the name of a Dicom image except "
882 <<
"for the .dcm extension\n";
886 checkData >> fCompression;
887 checkData >> fNFiles;
889 checkData.getline(oneLine,100);
890 std::ifstream testExistence;
891 G4bool existAlready =
true;
892 for(
G4int rep = 0; rep < fNFiles; rep++) {
893 checkData.getline(oneLine,100);
896 G4cout << fNFiles <<
" test file " << oneName <<
G4endl;
897 testExistence.open(oneName.
data());
898 if(!(testExistence.is_open())) {
899 existAlready =
false;
900 testExistence.clear();
901 testExistence.close();
903 testExistence.clear();
904 testExistence.close();
907 ReadMaterialIndices( checkData );
912 if( existAlready ==
false ) {
914 G4cout <<
"\nAll the necessary images were not found in processed form, starting "
915 <<
"with .dcm images\n";
919 char * fCompressionc =
new char[LINEBUFFSIZE];
920 char * maxc =
new char[LINEBUFFSIZE];
922 char *
name =
new char[FILENAMESIZE];
923 char * inputFile =
new char[FILENAMESIZE];
926 lecturePref = std::fopen(driverFile.c_str(),
"r");
927 rflag = std::fscanf(lecturePref,
"%s",fCompressionc);
928 fCompression = atoi(fCompressionc);
929 rflag = std::fscanf(lecturePref,
"%s",maxc);
930 fNFiles = atoi(maxc);
933 for(
G4int i = 1; i <= fNFiles; i++ ) {
935 rflag = std::fscanf(lecturePref,
"%s",inputFile);
936 std::sprintf(name,
"%s.dcm",inputFile);
937 std::cout <<
"check 1: " << name << std::endl;
939 std::printf(
"### Opening %s and reading :\n",name);
940 dicom = std::fopen(name,
"rb");
956 delete [] fCompressionc;
964 if(valuedensity) {
delete [] valuedensity; }
965 if(valueCT) {
delete [] valueCT; }
966 if(mergedSlices) {
delete mergedSlices; }
973 G4int DicomHandler::read_defined_nested(FILE * nested,
G4int SQ_Length)
976 unsigned short item_GroupNumber;
977 unsigned short item_ElementNumber;
979 G4int items_array_length=0;
980 char *
buffer=
new char[LINEBUFFSIZE];
983 while(items_array_length < SQ_Length)
985 rflag = std::fread(buffer, 2, 1, nested);
986 GetValue(buffer, item_GroupNumber);
988 rflag = std::fread(buffer, 2, 1, nested);
989 GetValue(buffer, item_ElementNumber);
991 rflag = std::fread(buffer, 4, 1, nested);
992 GetValue(buffer, item_Length);
994 rflag = std::fread(buffer, item_Length, 1, nested);
996 items_array_length= items_array_length+8+item_Length;
1001 if( SQ_Length>items_array_length )
1005 if (rflag)
return 1;
1010 void DicomHandler::read_undefined_nested(FILE * nested)
1013 unsigned short item_GroupNumber;
1014 unsigned short item_ElementNumber;
1015 unsigned int item_Length;
1016 char * buffer=
new char[LINEBUFFSIZE];
1021 rflag = std::fread(buffer, 2, 1, nested);
1022 GetValue(buffer, item_GroupNumber);
1024 rflag = std::fread(buffer, 2, 1, nested);
1025 GetValue(buffer, item_ElementNumber);
1027 rflag = std::fread(buffer, 4, 1, nested);
1028 GetValue(buffer, item_Length);
1030 if(item_Length!=0xffffffff)
1031 rflag = std::fread(buffer, item_Length, 1, nested);
1033 read_undefined_item(nested);
1036 }
while(item_GroupNumber!=0xFFFE || item_ElementNumber!=0xE0DD || item_Length!=0);
1044 void DicomHandler::read_undefined_item(FILE * nested)
1047 unsigned short item_GroupNumber;
1048 unsigned short item_ElementNumber;
1049 G4int item_Length;
size_t rflag = 0;
1050 char *buffer=
new char[LINEBUFFSIZE];
1054 rflag = std::fread(buffer, 2, 1, nested);
1055 GetValue(buffer, item_GroupNumber);
1057 rflag = std::fread(buffer, 2, 1, nested);
1058 GetValue(buffer, item_ElementNumber);
1060 rflag = std::fread(buffer, 4, 1, nested);
1061 GetValue(buffer, item_Length);
1065 rflag = std::fread(buffer,item_Length,1,nested);
1068 while(item_GroupNumber!=0xFFFE || item_ElementNumber!=0xE00D || item_Length!=0);
1076 template <
class Type>
1077 void DicomHandler::GetValue(
char * _val, Type & _rval) {
1079 #if BYTE_ORDER == BIG_ENDIAN
1081 #else // BYTE_ORDER == LITTLE_ENDIAN
1082 if(!fLittleEndian) {
1084 const int SIZE =
sizeof(_rval);
1086 for(
int i = 0; i < SIZE/2; i++) {
1088 _val[i] = _val[SIZE - 1 - i];
1089 _val[SIZE - 1 - i] = ctemp;
1092 _rval = *(Type *)_val;
Definition of the DicomPhantomZSliceMerged class.
static DicomHandler * Instance()
G4GLOB_DLL std::ostream G4cout
G4int ReadFile(FILE *, char *)
const char * data() const
G4int ReadData(FILE *, char *)
Definition of the DicomHandler class.
void AddZSlice(DicomPhantomZSliceHeader *val)
printf("%d Experimental points found\n", nlines)
const XML_Char const XML_Char * data
G4GLOB_DLL std::ostream G4cerr