1 /*=========================================================================
4 Module: $RCSfile: PrintFile.cxx,v $
6 Date: $Date: 2010/09/01 14:41:48 $
7 Version: $Revision: 1.94 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #include "gdcmDocument.h"
20 #include "gdcmSeqEntry.h"
21 #include "gdcmSQItem.h"
22 #include "gdcmDataEntry.h"
24 #include "gdcmFileHelper.h"
25 #include "gdcmDebug.h"
26 #include "gdcmDirList.h"
27 #include "gdcmGlobal.h"
28 #include "gdcmDictSet.h"
29 #include "gdcmArgMgr.h"
30 #include "gdcmOrientation.h"
33 /// \todo : code factorization, for 'single file' an 'whole directory' processing
35 void ShowLutData(GDCM_NAME_SPACE::File *f);
37 // Nothing is written yet to get LUT Data user friendly
38 // The following is to be moved into a PixelReadConvert method
39 // Let here, waiting for a clever idea on the way to do it.
41 void ShowLutData(GDCM_NAME_SPACE::File *f)
43 GDCM_NAME_SPACE::SeqEntry *modLutSeq = f->GetSeqEntry(0x0028,0x3000);
46 GDCM_NAME_SPACE::SQItem *sqi= modLutSeq->GetFirstSQItem();
49 std::string lutDescriptor = sqi->GetEntryString(0x0028,0x3002);
50 if ( /*lutDescriptor == GDCM_UNFOUND*/ 0 )
52 std::cout << "LUT Descriptor is missing" << std::endl;
55 int length; // LUT length in Bytes
56 int deb; // Subscript of the first Lut Value
57 int nbits; // Lut item size (in Bits)
59 int nbRead; // nb of items in LUT descriptor (must be = 3)
61 nbRead = sscanf( lutDescriptor.c_str(),
63 &length, &deb, &nbits );
64 std::cout << "length " << length
70 std::cout << "Wrong LUT descriptor" << std::endl;
72 //LUT Data (CTX dependent)
73 GDCM_NAME_SPACE::DataEntry *b = sqi->GetDataEntry(0x0028,0x3006);
76 int BitsAllocated = f->GetBitsAllocated();
77 if ( BitsAllocated <= 8 )
80 if ( ( nbits == 16 ) && ( BitsAllocated == 8 ) )
82 // when LUT item size is different than pixel size
83 mult = 2; // high byte must be = low byte
87 // See PS 3.3-2003 C.11.1.1.2 p 619
90 uint8_t *lut = b->GetBinArea();
91 for( int i=0; i < length; ++i )
93 std::cout << i+deb << " : \t"
94 << (int) (lut[i*mult + 1]) << std::endl;
99 uint16_t *lut = (uint16_t *)(b->GetBinArea());
100 for( int i=0; i < length; ++i )
102 std::cout << i+deb << " : \t"
103 << (int) (((uint16_t *)lut)[i])
109 std::cout << "No LUT Data DataEntry (0x0028,0x3006) found?!? "
113 std::cout << "No First SQ Item within (0x0028,0x3000) ?!? "
117 std::cout << "No LUT Data SeqEntry (0x0028,0x3000) found "
121 int main(int argc, char *argv[])
125 " \n PrintFile : \n ",
126 " Display the header of a ACR-NEMA/PAPYRUS/DICOM File ",
127 " usage: PrintFile {filein=inputFileName|dirin=inputDirectoryName}[level=n]",
128 " [forceload=listOfElementsToForceLoad] [rec] [noex] ",
129 " [4DLoc= ][dict= privateDirectory] ",
130 " [ { [noshadowseq] | [noshadow][noseq] } ] [load] ",
131 " [debug] [warning] ",
132 " level = 0,1,2 : depending on the amount of details user wants to see",
133 " rec : user wants to parse recursively the directory ",
134 " load : user wants to load the pixels, as well (to see warning info) ",
135 " noex : user doesn't want extra 'user friendly' info ",
136 " 4DLoc: group-elem(in hexa, no space) of the DataEntry holdind 4thDim",
137 " listOfElementsToForceLoad : group-elem,g2-e2,... (in hexa, no space)",
138 " of Elements to load whatever their length ",
139 " privateDirectory : source file full path name of Shadow Group elems ",
140 " noshadowseq: user doesn't want to load Private Sequences ",
141 " noshadow : user doesn't want to load Private groups (odd number) ",
142 " noseq : user doesn't want to load Sequences ",
143 " debug : user wants to run the program in 'debug mode' ",
144 " warning : user wants to be warned about any oddity in the File ",
145 " showlut :user wants to display the Palette Color (as an int array) ",
148 // Initialize Arguments Manager
149 GDCM_NAME_SPACE::ArgMgr *am= new GDCM_NAME_SPACE::ArgMgr(argc, argv);
151 if (argc == 1 || am->ArgMgrDefined("usage") )
153 am->ArgMgrUsage(usage); // Display 'usage'
158 const char *fileName = am->ArgMgrGetString("filein");
159 const char *dirName = am->ArgMgrGetString("dirin");
161 if ( (fileName == 0 && dirName == 0) ||
162 (fileName != 0 && dirName != 0) )
164 std::cerr << std::endl
165 << "Either 'filein=' or 'dirin=' must be present;"
166 << std::endl << "Not both" << std::endl;
167 am->ArgMgrUsage(usage); // Display 'usage'
172 bool noex = ( 0 != am->ArgMgrDefined("noex") );
173 bool rec = ( 0 != am->ArgMgrDefined("rec") );
175 if (am->ArgMgrDefined("debug"))
176 GDCM_NAME_SPACE::Debug::DebugOn();
178 if (am->ArgMgrDefined("warning"))
179 GDCM_NAME_SPACE::Debug::WarningOn();
181 int loadMode = GDCM_NAME_SPACE::LD_ALL;
182 if ( am->ArgMgrDefined("noshadowseq") )
183 loadMode |= GDCM_NAME_SPACE::LD_NOSHADOWSEQ;
186 if ( am->ArgMgrDefined("noshadow") )
187 loadMode |= GDCM_NAME_SPACE::LD_NOSHADOW;
188 if ( am->ArgMgrDefined("noseq") )
189 loadMode |= GDCM_NAME_SPACE::LD_NOSEQ;
192 int level = am->ArgMgrGetInt("level", 1);
195 uint16_t *elemsToForceLoad
196 = am->ArgMgrGetXInt16Enum("forceload", &forceLoadNb);
199 uint16_t *FourthDimLoc;
200 if ( am->ArgMgrDefined("4DLoc") )
202 FourthDimLoc = am->ArgMgrGetXInt16Enum("4DLoc", &nbP);
206 std::cout << "4DLoc must have 2 and only 2 components!" << std::endl;
212 bool load = ( 0 != am->ArgMgrDefined("load") );
214 bool showlut = ( 0 != am->ArgMgrDefined("SHOWLUT") );
216 bool ddict = am->ArgMgrDefined("dict") ? true : false;
217 const char *dict = 0;
221 dict = am->ArgMgrGetString("dict",0);
224 /* if unused Param we give up */
225 if ( am->ArgMgrPrintUnusedLabels() )
227 am->ArgMgrUsage(usage);
232 delete am; // we don't need Argument Manager any longer
234 // ----------- End Arguments Manager ---------
239 GDCM_NAME_SPACE::Global::GetDicts()->GetDefaultPubDict()->AddDict(dict);
242 if ( fileName != 0 ) // ====== Deal with a single file ======
244 GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
245 f->SetLoadMode(loadMode);
246 f->SetFileName( fileName );
247 f->SetMaxSizeLoadEntry(0xffff);
249 for (int ri=0; ri<forceLoadNb; ri++)
251 f->AddForceLoadElement((uint32_t)elemsToForceLoad[2*ri],
252 (uint32_t)elemsToForceLoad[2*ri+1] );
255 // TODO : find why such a polution
256 // To avoid polluting the output with messages
257 // 'Last system error was : No such file or directory'
267 catch(std::exception &ex)
269 std::cerr << "sorry an exception was thrown: " << ex.what() << std::endl;
271 // GDCM_NAME_SPACE::File::IsReadable() is no usable here, because we deal with
272 // any kind of gdcm-Parsable *document*
273 // not only GDCM_NAME_SPACE::File (as opposed to GDCM_NAME_SPACE::DicomDir)
276 std::cout << "Cannot process file [" << fileName << "]" << std::endl;
277 std::cout << "Either it doesn't exist, or it's read protected "
279 std::cout << "or it's not a Dicom File, or its 'header' is bugged"
281 std::cout << "use 'PrintFile filein=... debug' to try to guess the pb"
288 f->SetFourthDimensionLocation(FourthDimLoc[0],FourthDimLoc[1]);
291 GDCM_NAME_SPACE::FileHelper *fh = GDCM_NAME_SPACE::FileHelper::New(f);
292 fh->SetPrintLevel( level );
296 std::cout << "\n\n" << std::endl;
298 std::cout <<std::endl;
299 std::cout <<" dataSize " << fh->GetImageDataSize() << std::endl;
300 std::cout <<" dataSizeRaw " << fh->GetImageDataRawSize() << std::endl;
303 int nX,nY,nZ,nT,sPP,planarConfig;
304 std::string pixelType;
309 std::cout << " DIMX=" << nX << " DIMY=" << nY
310 << " DIMZ=" << nZ << " DIMT=" << nT
313 pixelType = f->GetPixelType();
314 sPP = f->GetSamplesPerPixel();
315 std::cout << " pixelType= [" << pixelType
316 << "] SamplesPerPixel= [" << sPP
321 planarConfig = f->GetPlanarConfiguration();
322 std::cout << " PlanarConfiguration= [" << planarConfig
325 std::cout << " PhotometricInterpretation= ["
326 << f->GetEntryString(0x0028,0x0004)
329 int numberOfScalarComponents=f->GetNumberOfScalarComponents();
330 std::cout << " NumberOfScalarComponents = " << numberOfScalarComponents
332 << " LUT = " << (f->HasLUT() ? "TRUE" : "FALSE")
335 if ( f->GetDataEntry(0x0002,0x0010) )
336 if ( f->GetDataEntry(0x0002,0x0010)->IsNotLoaded() )
338 std::cout << "Transfer Syntax not loaded. " << std::endl
339 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
345 std::string transferSyntaxName = f->GetTransferSyntaxName();
346 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]"
348 std::cout << " SwapCode= " << f->GetSwapCode() << std::endl;
349 std::cout << " ------" << std::endl;
352 std::cout << "\n\n" << std::endl;
353 std::cout << "X spacing " << f->GetXSpacing() << std::endl;
354 std::cout << "Y spacing " << f->GetYSpacing() << std::endl;
355 std::cout << "Z spacing " << f->GetZSpacing() << std::endl;
357 //------------------------------
359 // Let's get and print some usefull fields about 'Orientation'
360 // ------------------------------------------------------------
362 std::string strPatientPosition =
363 f->GetEntryString(0x0018,0x5100);
364 if ( strPatientPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
365 && strPatientPosition != "" )
366 std::cout << "PatientPosition (0x0010,0x5100)= ["
367 << strPatientPosition << "]" << std::endl;
369 std::string strViewPosition =
370 f->GetEntryString(0x0018,0x5101);
371 if ( strViewPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
372 && strViewPosition != "" )
373 std::cout << "View Position (0x0018,0x5101)= ["
374 << strViewPosition << "]" << std::endl;
376 std::string strPatientOrientation =
377 f->GetEntryString(0x0020,0x0020);
378 if ( strPatientOrientation != GDCM_NAME_SPACE::GDCM_UNFOUND
379 && strPatientOrientation != "")
380 std::cout << "PatientOrientation (0x0020,0x0020)= ["
381 << strPatientOrientation << "]" << std::endl;
383 std::string strImageOrientationPatient =
384 f->GetEntryString(0x0020,0x0037);
385 if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND
386 && strImageOrientationPatient != "" )
387 std::cout << "ImageOrientationPatient (0x0020,0x0037)= ["
388 << strImageOrientationPatient << "]" << std::endl;
390 std::string strImageOrientationRET =
391 f->GetEntryString(0x0020,0x0035);
392 if ( strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND
393 && strImageOrientationRET != "" )
394 std::cout << "ImageOrientationRET (0x0020,0x0035)= ["
395 << strImageOrientationRET << "]" << std::endl;
397 std::string strImagePositionPatient =
398 f->GetEntryString(0x0020,0x0032);
399 if ( strImagePositionPatient != GDCM_NAME_SPACE::GDCM_UNFOUND
400 && strImagePositionPatient != "" )
401 std::cout << "ImagePositionPatient (0x0020,0x0032)= ["
402 << strImagePositionPatient << "]" << std::endl;
404 std::string strImagePositionPatientRET =
405 f->GetEntryString(0x0020,0x0030);
406 if ( strImagePositionPatientRET != GDCM_NAME_SPACE::GDCM_UNFOUND
407 && strImagePositionPatientRET != "" )
408 std::cout << "ImagePositionPatientRET (0x0020,0x0030)= ["
409 << strImagePositionPatientRET << "]" << std::endl;
413 f->GetImageOrientationPatient(iop);
416 f->GetImagePositionPatient(ipp);
418 std::cout << "Image Position (0x0020,0x0032|0x0030) : "
419 << ipp[0] << " , " << ipp[1] << " , "<< ipp[2]
421 std::cout << "Image Orientation (0x0020,0x0037|0x0035) : "
422 << iop[0] << " , " << iop[1] << " , "<< iop[2] << " , "
423 << iop[3] << " , " << iop[4] << " , "<< iop[5]
427 // Let's compute 'user friendly' results about 'Orientation'
428 // ---------------------------------------------------------
430 GDCM_NAME_SPACE::Orientation *o = GDCM_NAME_SPACE::Orientation::New();
432 if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND ||
433 strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND )
436 GDCM_NAME_SPACE::OrientationType orient = o->GetOrientationType( f );
438 std::cout << "TypeOrientation = " << orient << " (-> "
439 << o->GetOrientationTypeString(orient) << " )" << std::endl;
442 std::string ori = o->GetOrientation ( f );
444 std::cout << "Orientation [" << ori << "]" << std::endl;
449 std::vector <double> valueVector;
450 GDCM_NAME_SPACE::DataEntry *e_0018_5212 = f->GetDataEntry(0x0018, 0x5212);
451 bool resJP = e_0018_5212->GetDSValue(valueVector);
454 for ( int i=0; i < 3; i++ ) {
455 test = valueVector[i];
456 std::cout << " test " << test << std::endl;
459 //e_0018_5212->Delete();
463 /* -----------------------------
466 std::cout << std::endl << std::endl << "===========Try Get Numerical ======="
468 GDCM_NAME_SPACE::DataEntry *e;
470 std::vector<double> vd;
473 e=f->GetDataEntry(0x0002,0x0010);
475 res=e->GetNumerical(vd);
477 std::cout << "0x0002,0x0010 not numerical, size =" << vd.size() << std::endl;
481 e=f->GetDataEntry(0x0028,0x0011);
483 res=e->GetNumerical(vd);
485 std::cout << "0x0028,0x0011 not numerical, size =" << vd.size() << std::endl;
487 std::cout << "0x0028,0x0011 numerical, size =" << vd.size() << std::endl;
488 std::cout << vd[0]<< std::endl;
492 e=f->GetDataEntry(0x0020,0x0032);
494 res=e->GetNumerical(vd);
496 std::cout << "0x0020,0x0032 not numerical, size =" << vd.size() << std::endl;
498 std::cout << "0x0020,0x0032 numerical, size =" << vd.size() << std::endl;
499 for(int l=0; l<vd.size(); l++)
500 std::cout << "vd[" << l << "]=" << vd[l]<< std::endl;
506 e=f->GetDataEntry(0x0028,0x0030);
508 res=e->GetNumerical(vd);
510 std::cout << "0x0028,0x0030 not numerical, size =" << vd.size() << std::endl;
512 std::cout << "0x0028,0x0030 numerical, size =" << vd.size() << std::endl;
513 for(int l=0; l<vd.size(); l++)
514 std::cout << "vd[" << l << "]=" << vd[l]<< std::endl;
518 ----------------------------------------------*/
521 //------------------------------
524 // Display the LUT as an int array (for debugging purpose)
525 if ( f->HasLUT() && showlut )
527 uint8_t* lutrgba = fh->GetLutRGBA();
530 std::cout << "Lut RGBA (Palette Color) not built " << std::endl;
532 // Nothing is written yet to get LUT Data user friendly
533 // The following is to be moved into a PixelRedaConvert method
535 GDCM_NAME_SPACE::SeqEntry *modLutSeq = f->GetSeqEntry(0x0028,0x3000);
538 GDCM_NAME_SPACE::SQItem *sqi= modLutSeq->GetFirstSQItem();
541 std::string lutDescriptor = sqi->GetEntryString(0x0028,0x3002);
542 int length; // LUT length in Bytes
543 int deb; // Subscript of the first Lut Value
544 int nbits; // Lut item size (in Bits)
545 int nbRead; // nb of items in LUT descriptor (must be = 3)
547 nbRead = sscanf( lutDescriptor.c_str(),
549 &length, &deb, &nbits );
552 std::cout << "Wrong LUT descriptor" << std::endl;
554 GDCM_NAME_SPACE::DataEntry *b = sqi->GetDataEntry(0x0028,0x3006);
557 if ( b->GetLength() != 0 )
559 std::cout << "---------------------------------------"
560 << " We should never reach this point "
562 //LoadEntryBinArea(b); //LUT Data (CTX dependent)
568 std::cout << "No LUT Data (0x0028,0x3000) found " << std::endl;
573 if ( fh->GetLutItemSize() == 8 )
575 for (int i=0;i<fh->GetLutItemNumber();i++)
576 std::cout << i << " : \t"
577 << (int)(lutrgba[i*4]) << " "
578 << (int)(lutrgba[i*4+1]) << " "
579 << (int)(lutrgba[i*4+2]) << std::endl;
581 else // LutItemSize assumed to be = 16
583 uint16_t* lutrgba16 = (uint16_t*)lutrgba;
584 for (int i=0;i<fh->GetLutItemNumber();i++)
585 std::cout << i << " : \t"
586 << (int)(lutrgba16[i*4]) << " "
587 << (int)(lutrgba16[i*4+1]) << " "
588 << (int)(lutrgba16[i*4+2]) << std::endl;
595 std::cout << "Try LUT Data "<< std::endl;
599 // Parsability of the GDCM_NAME_SPACE::Document already checked, after Load() !
601 if ( f->IsReadable() )
603 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
605 else if ( f->GetSeqEntry(0x0041,0x1010) )
607 std::cout <<std::endl<<fileName<<" looks like a 'PAPYRUS image' file"
610 else if ( f->GetSeqEntry(0x0004,0x1220) )
612 std::cout <<std::endl<<fileName<<" looks like a 'DICOMDIR file'"
617 std::cout <<std::endl<<fileName<<" doesn't look like an image file "
621 std::cout<<std::flush;
625 // ===========================================================================
626 else // =============================== Deal with a Directory =====================
627 { // ===========================================================================
628 std::cout << "dirName [" << dirName << "]" << std::endl;
630 GDCM_NAME_SPACE::DirList dirList(dirName,rec); // gets recursively (or not) the file list
631 GDCM_NAME_SPACE::DirListType fileList = dirList.GetFilenames();
632 GDCM_NAME_SPACE::File *f;
635 if (fileList.size() == 0)
637 std::cout << "No file found in : [" << dirName << "]" << std::endl;
640 for( GDCM_NAME_SPACE::DirListType::iterator it = fileList.begin();
641 it != fileList.end();
644 std::cout << std::endl<<" Start processing :[" << it->c_str() << "]"
646 f = GDCM_NAME_SPACE::File::New();
647 f->SetLoadMode(loadMode);
648 f->SetFileName( it->c_str() );
650 for (int ri=0; ri<forceLoadNb; ri++)
652 printf("%04x,%04x\n",elemsToForceLoad[2*ri],
653 elemsToForceLoad[2*ri+1]);
654 f->AddForceLoadElement((uint32_t)elemsToForceLoad[2*ri],
655 (uint32_t)elemsToForceLoad[2*ri+1]);
661 std::cout << "Cannot process file [" << it->c_str() << "]"
663 std::cout << "Either it doesn't exist, or it's read protected "
665 std::cout << "or it's not a Dicom File, or its 'header' is bugged"
667 std::cout << "use 'PrintFile filein=... debug' "
668 << "to try to guess the pb"
674 GDCM_NAME_SPACE::FileHelper *fh = GDCM_NAME_SPACE::FileHelper::New(f);
675 fh->SetPrintLevel( level );
678 //------------------------------
681 // Lets's get and print some usefull fields about 'Orientation'
682 // ------------------------------------------------------------
684 std::string strPatientPosition =
685 f->GetEntryString(0x0018,0x5100);
686 if ( strPatientPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
687 && strPatientPosition != "" )
688 std::cout << "PatientPosition (0x0010,0x5100)= ["
689 << strPatientPosition << "]" << std::endl;
691 std::string strViewPosition =
692 f->GetEntryString(0x0018,0x5101);
693 if ( strViewPosition != GDCM_NAME_SPACE::GDCM_UNFOUND
694 && strViewPosition != "" )
695 std::cout << "strViewPosition (0x0010,0x5101)= ["
696 << strViewPosition << "]" << std::endl;
698 std::string strPatientOrientation =
699 f->GetEntryString(0x0020,0x0020);
700 if ( strPatientOrientation != GDCM_NAME_SPACE::GDCM_UNFOUND
701 && strPatientOrientation != "")
702 std::cout << "PatientOrientation (0x0020,0x0020)= ["
703 << strPatientOrientation << "]" << std::endl;
705 std::string strImageOrientationPatient =
706 f->GetEntryString(0x0020,0x0037);
707 if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND
708 && strImageOrientationPatient != "" )
709 std::cout << "ImageOrientationPatient (0x0020,0x0037)= ["
710 << strImageOrientationPatient << "]" << std::endl;
712 std::string strImageOrientationRET =
713 f->GetEntryString(0x0020,0x0035);
714 if ( strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND
715 && strImageOrientationRET != "" )
717 std::cout << "ImageOrientationRET (0x0020,0x0035)= ["
718 << strImageOrientationRET << "]" << std::endl;
721 // Let's compute 'user friendly' results about 'Orientation'
722 // ---------------------------------------------------------
724 GDCM_NAME_SPACE::Orientation *o = GDCM_NAME_SPACE::Orientation::New();
727 if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND ||
728 strImageOrientationRET != GDCM_NAME_SPACE::GDCM_UNFOUND )
731 GDCM_NAME_SPACE::OrientationType orient = o->GetOrientationType( f );
733 std::cout << "TypeOrientation = " << orient << " (-> "
734 << o->GetOrientationTypeString(orient) << " )" << std::endl;
737 std::string ori = o->GetOrientation ( f );
739 std::cout << "Orientation [" << ori << "]" << std::endl;
742 //-------------------------------
746 if (load) // just to see warning messages at load time !
748 uint8_t *pixels = fh->GetImageData(); (void)pixels;
749 uint32_t lgth = fh->GetImageDataSize(); (void)lgth;
752 std::cout <<std::endl<<it->c_str()<<" is Readable"<<std::endl;
755 std::cout <<std::endl<<it->c_str()<<" is NOT Readable"<<std::endl;
756 std::cout << "\n\n" << std::endl;
763 std::cout<<std::flush;