24 #include "itksys/SystemTools.hxx"
65 unsigned int GCPCount = 0;
82 std::ostringstream lStream;
89 itk::ExposeMetaData<OTB_GCP>(dict, key,
m_GCP);
100 std::ostringstream lStream;
107 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
119 std::ostringstream lStream;
126 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
138 std::ostringstream lStream;
145 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
157 std::ostringstream lStream;
164 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
176 std::ostringstream lStream;
183 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
195 std::ostringstream lStream;
202 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
214 std::ostringstream lStream;
221 itk::ExposeMetaData<OTB_GCP>(dict, key, gcp);
237 return (adfGeoTransform);
250 return (UpperLeftCorner);
263 return (UpperRightCorner);
276 return (LowerLeftCorner);
289 return (LowerRightCorner);
302 return (imageKeywordlist);
315 return (imageKeywordlist);
329 if (!imageKeywordlist.
HasKey(
"sensor"))
348 if (!imageKeywordlist.
HasKey(
"support_data.number_bands"))
353 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"support_data.number_bands");
354 unsigned int value = atoi(valueString.c_str());
358 std::vector<std::string>
370 std::vector<std::string> outputValues;
371 if (!imageKeywordlist.
HasKey(
"support_data.band_name"))
373 if (imageKeywordlist.
HasKey(
"support_data.band_name_list"))
375 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"support_data.band_name_list");
376 itksys::SystemTools::Split(valueString.c_str(), outputValues,
' ');
383 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"support_data.band_name");
384 itksys::SystemTools::Split(valueString.c_str(), outputValues,
'/');
401 if (imageKeywordlist.
HasKey(
"meters_per_pixel_x"))
403 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"meters_per_pixel_x");
404 double value = atof(valueString.c_str());
408 if (imageKeywordlist.
HasKey(
"pixel_spacing"))
410 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"pixel_spacing");
411 double value = atof(valueString.c_str());
429 if (imageKeywordlist.
HasKey(
"meters_per_pixel_y"))
431 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"meters_per_pixel_y");
432 double value = atof(valueString.c_str());
436 if (imageKeywordlist.
HasKey(
"pixel_spacing"))
438 std::string valueString = imageKeywordlist.
GetMetadataByKey(
"pixel_spacing");
439 double value = atof(valueString.c_str());
452 std::vector<std::string> keys = dict.
GetKeys();
454 unsigned int ivalue(0);
468 for (
unsigned int itkey = 0; itkey < keys.size(); ++itkey)
474 itk::ExposeMetaData<std::string>(dict2, keys[itkey], svalue);
475 os << indent <<
"---> " << keys[itkey] <<
" = " << svalue << std::endl;
479 itk::ExposeMetaData<unsigned int>(dict2, keys[itkey], ivalue);
480 os << indent <<
"---> " << keys[itkey] <<
" = " << ivalue << std::endl;
484 itk::ExposeMetaData<VectorType>(dict2, keys[itkey], vvalue);
486 for (i = 0; i < vvalue.size(); ++i)
488 os << indent <<
"---> " << keys[itkey] <<
"[" << i <<
"] = " << vvalue[i] << std::endl;
495 itk::ExposeMetaData<double>(dict2, keys[itkey], dvalue);
496 os << indent <<
"---> " << keys[itkey] <<
" = " << dvalue << std::endl;
500 itk::ExposeMetaData<OTB_GCP>(dict2, keys[itkey], gcpvalue);
502 os << indent <<
"---> " << keys[itkey] << std::endl;
506 itk::ExposeMetaData<ImageKeywordlist>(dict2, keys[itkey], kwl);
508 os << indent <<
"---> " << keys[itkey] << std::endl;
529 this->Superclass::PrintSelf(os, indent);
531 bool canRead = this->CanRead();
533 os << indent <<
"Initialized: " << (canRead ?
true :
false) << std::endl;
536 std::vector<unsigned int> defaultDisplay = this->GetDefaultDisplay();
537 os << indent <<
"Default RGB Display: ["
538 << defaultDisplay[0] <<
", "
539 << defaultDisplay[1] <<
", "
540 << defaultDisplay[2] <<
"]" << std::endl;
541 os << indent <<
"ProjectionRef: " << this->GetProjectionRef() << std::endl;
542 os << indent <<
"GCPProjection: " << this->GetGCPProjection( ) << std::endl;
543 os << indent <<
"GCPCount: " << this->GetGCPCount( ) << std::endl;
544 for(
unsigned int gcpIdx = 0; gcpIdx < this->GetGCPCount(); ++ gcpIdx)
547 os << indent <<
"GCPId: " << this->GetGCPId(gcpIdx) << std::endl;
548 os << indent <<
"GCPInfo: " << this->GetGCPInfo(gcpIdx) << std::endl;
556 os << indent <<
"SensorID: " << this->GetSensorID( ) << std::endl;
557 os << indent <<
"NumberOfBands: " << this->GetNumberOfBands( ) << std::endl;
559 std::vector<std::string> bandNameList = this->GetBandName();
560 if (bandNameList.size() == 1)
562 os << indent <<
"BandName: " << bandNameList[0] << std::endl;
565 if (bandNameList.size() > 1)
567 os << indent <<
"BandNameList: ";
568 for (std::vector<std::string>::iterator it = bandNameList.begin(); it != bandNameList.end(); ++it)
574 os << indent <<
"XPixelSpacing: " << this->GetXPixelSpacing( ) << std::endl;
575 os << indent <<
"YPixelSpacing: " << this->GetYPixelSpacing( ) << std::endl;
576 os << indent <<
"Day: " << this->GetDay( ) << std::endl;
577 os << indent <<
"Month: " << this->GetMonth( ) << std::endl;
578 os << indent <<
"Year: " << this->GetYear( ) << std::endl;
579 os << indent <<
"Hour: " << this->GetHour( ) << std::endl;
580 os << indent <<
"Minute: " << this->GetMinute( ) << std::endl;
581 os << indent <<
"ProductionDay: " << this->GetProductionDay( ) << std::endl;
582 os << indent <<
"ProductionMonth: " << this->GetProductionMonth( ) << std::endl;
583 os << indent <<
"ProductionYear: " << this->GetProductionYear( ) << std::endl;