Skip to content
Snippets Groups Projects
Commit 2e1930ec authored by Julien Malik's avatar Julien Malik
Browse files

BUG: handle PrintSelf when object is not initialized

parent 3ee23175
No related branches found
No related tags found
No related merge requests found
......@@ -508,40 +508,45 @@ ImageMetadataInterfaceBase
{
this->Superclass::PrintSelf(os, indent);
std::vector<unsigned int> defaultDisplay = this->GetDefaultDisplay();
os << indent << "Default RGB Display: ["
<< defaultDisplay[0] << ", "
<< defaultDisplay[1] << ", "
<< defaultDisplay[2] << "]" << std::endl;
os << indent << "ProjectionRef: " << this->GetProjectionRef() << std::endl;
os << indent << "GCPProjection: " << this->GetGCPProjection( ) << std::endl;
os << indent << "GCPCount: " << this->GetGCPCount( ) << std::endl;
for(unsigned int gcpIdx = 0; gcpIdx < this->GetGCPCount(); ++ gcpIdx)
{
//os << indent << "GCPs: " << this->GetGCPs(gcpIdx) << std::endl;
os << indent << "GCPId: " << this->GetGCPId(gcpIdx) << std::endl;
os << indent << "GCPInfo: " << this->GetGCPInfo(gcpIdx) << std::endl;
}
//os << indent << "GeoTransform: " << this->GetGeoTransform( ) << std::endl;
//os << indent << "UpperLeftCorner: " << this->GetUpperLeftCorner( ) << std::endl;
//os << indent << "UpperRightCorner:" << this->GetUpperRightCorner( ) << std::endl;
//os << indent << "LowerLeftCorner: " << this->GetLowerLeftCorner( ) << std::endl;
//os << indent << "LowerRightCorner:" << this->GetLowerRightCorner( ) << std::endl;
//os << indent << "ImageKeywordlist:" << this->GetImageKeywordlist( ) << std::endl;
os << indent << "SensorID: " << this->GetSensorID( ) << std::endl;
os << indent << "NumberOfBands: " << this->GetNumberOfBands( ) << std::endl;
//os << indent << "BandName: " << this->GetBandName( ) << std::endl;
os << indent << "XPixelSpacing: " << this->GetXPixelSpacing( ) << std::endl;
os << indent << "YPixelSpacing: " << this->GetYPixelSpacing( ) << std::endl;
os << indent << "Day: " << this->GetDay( ) << std::endl;
os << indent << "Month: " << this->GetMonth( ) << std::endl;
os << indent << "Year: " << this->GetYear( ) << std::endl;
os << indent << "Hour: " << this->GetHour( ) << std::endl;
os << indent << "Minute: " << this->GetMinute( ) << std::endl;
os << indent << "ProductionDay: " << this->GetProductionDay( ) << std::endl;
os << indent << "ProductionMonth: " << this->GetProductionMonth( ) << std::endl;
os << indent << "ProductionYear: " << this->GetProductionYear( ) << std::endl;
bool canRead = this->CanRead();
os << indent << "Initialized: " << (canRead ? true : false) << std::endl;
if (canRead)
{
std::vector<unsigned int> defaultDisplay = this->GetDefaultDisplay();
os << indent << "Default RGB Display: ["
<< defaultDisplay[0] << ", "
<< defaultDisplay[1] << ", "
<< defaultDisplay[2] << "]" << std::endl;
os << indent << "ProjectionRef: " << this->GetProjectionRef() << std::endl;
os << indent << "GCPProjection: " << this->GetGCPProjection( ) << std::endl;
os << indent << "GCPCount: " << this->GetGCPCount( ) << std::endl;
for(unsigned int gcpIdx = 0; gcpIdx < this->GetGCPCount(); ++ gcpIdx)
{
//os << indent << "GCPs: " << this->GetGCPs(gcpIdx) << std::endl;
os << indent << "GCPId: " << this->GetGCPId(gcpIdx) << std::endl;
os << indent << "GCPInfo: " << this->GetGCPInfo(gcpIdx) << std::endl;
}
//os << indent << "GeoTransform: " << this->GetGeoTransform( ) << std::endl;
//os << indent << "UpperLeftCorner: " << this->GetUpperLeftCorner( ) << std::endl;
//os << indent << "UpperRightCorner:" << this->GetUpperRightCorner( ) << std::endl;
//os << indent << "LowerLeftCorner: " << this->GetLowerLeftCorner( ) << std::endl;
//os << indent << "LowerRightCorner:" << this->GetLowerRightCorner( ) << std::endl;
//os << indent << "ImageKeywordlist:" << this->GetImageKeywordlist( ) << std::endl;
os << indent << "SensorID: " << this->GetSensorID( ) << std::endl;
os << indent << "NumberOfBands: " << this->GetNumberOfBands( ) << std::endl;
//os << indent << "BandName: " << this->GetBandName( ) << std::endl;
os << indent << "XPixelSpacing: " << this->GetXPixelSpacing( ) << std::endl;
os << indent << "YPixelSpacing: " << this->GetYPixelSpacing( ) << std::endl;
os << indent << "Day: " << this->GetDay( ) << std::endl;
os << indent << "Month: " << this->GetMonth( ) << std::endl;
os << indent << "Year: " << this->GetYear( ) << std::endl;
os << indent << "Hour: " << this->GetHour( ) << std::endl;
os << indent << "Minute: " << this->GetMinute( ) << std::endl;
os << indent << "ProductionDay: " << this->GetProductionDay( ) << std::endl;
os << indent << "ProductionMonth: " << this->GetProductionMonth( ) << std::endl;
os << indent << "ProductionYear: " << this->GetProductionYear( ) << std::endl;
}
}
......
......@@ -86,15 +86,19 @@ OpticalImageMetadataInterface
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
this->Superclass::PrintSelf(os, indent);
os << indent << "GetSunElevation: " << this->GetSunElevation() << std::endl;
os << indent << "GetSunAzimuth: " << this->GetSunAzimuth() << std::endl;
os << indent << "GetSatElevation: " << this->GetSatElevation() << std::endl;
os << indent << "GetSatAzimuth: " << this->GetSatAzimuth() << std::endl;
os << indent << "GetPhysicalBias: " << this->GetPhysicalBias() << std::endl;
os << indent << "GetPhysicalGain: " << this->GetPhysicalGain() << std::endl;
os << indent << "GetSolarIrradiance: " << this->GetSolarIrradiance() << std::endl;
os << indent << "GetFirstWavelengths: " << this->GetFirstWavelengths() << std::endl;
os << indent << "GetLastWavelengths: " << this->GetLastWavelengths() << std::endl;
if (this->CanRead())
{
os << indent << "GetSunElevation: " << this->GetSunElevation() << std::endl;
os << indent << "GetSunAzimuth: " << this->GetSunAzimuth() << std::endl;
os << indent << "GetSatElevation: " << this->GetSatElevation() << std::endl;
os << indent << "GetSatAzimuth: " << this->GetSatAzimuth() << std::endl;
os << indent << "GetPhysicalBias: " << this->GetPhysicalBias() << std::endl;
os << indent << "GetPhysicalGain: " << this->GetPhysicalGain() << std::endl;
os << indent << "GetSolarIrradiance: " << this->GetSolarIrradiance() << std::endl;
os << indent << "GetFirstWavelengths: " << this->GetFirstWavelengths() << std::endl;
os << indent << "GetLastWavelengths: " << this->GetLastWavelengths() << std::endl;
}
}
......
......@@ -155,18 +155,22 @@ SarImageMetadataInterface
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << "GetRadiometricCalibrationScale: " << this->GetRadiometricCalibrationScale() << std::endl;
os << indent << "GetRadiometricCalibrationNoise: " << this->GetRadiometricCalibrationNoise() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternNewGain: " << this->GetRadiometricCalibrationAntennaPatternNewGain() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternOldGain: " << this->GetRadiometricCalibrationAntennaPatternOldGain() << std::endl;
os << indent << "GetRadiometricCalibrationIncidenceAngle: " << this->GetRadiometricCalibrationIncidenceAngle() << std::endl;
os << indent << "GetRadiometricCalibrationRangeSpreadLoss: " << this->GetRadiometricCalibrationRangeSpreadLoss() << std::endl;
os << indent << "GetConstantPolynomialDegree: " << this->GetConstantPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationNoisePolynomialDegree: " << this->GetRadiometricCalibrationNoisePolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree: " << this->GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree: " << this->GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationIncidenceAnglePolynomialDegree: " << this->GetRadiometricCalibrationIncidenceAnglePolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationRangeSpreadLossPolynomialDegree: " << this->GetRadiometricCalibrationRangeSpreadLossPolynomialDegree() << std::endl;
if (this->CanRead())
{
os << indent << "GetRadiometricCalibrationScale: " << this->GetRadiometricCalibrationScale() << std::endl;
os << indent << "GetRadiometricCalibrationNoise: " << this->GetRadiometricCalibrationNoise() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternNewGain: " << this->GetRadiometricCalibrationAntennaPatternNewGain() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternOldGain: " << this->GetRadiometricCalibrationAntennaPatternOldGain() << std::endl;
os << indent << "GetRadiometricCalibrationIncidenceAngle: " << this->GetRadiometricCalibrationIncidenceAngle() << std::endl;
os << indent << "GetRadiometricCalibrationRangeSpreadLoss: " << this->GetRadiometricCalibrationRangeSpreadLoss() << std::endl;
os << indent << "GetConstantPolynomialDegree: " << this->GetConstantPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationNoisePolynomialDegree: " << this->GetRadiometricCalibrationNoisePolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree: " << this->GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree: " << this->GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationIncidenceAnglePolynomialDegree: " << this->GetRadiometricCalibrationIncidenceAnglePolynomialDegree() << std::endl;
os << indent << "GetRadiometricCalibrationRangeSpreadLossPolynomialDegree: " << this->GetRadiometricCalibrationRangeSpreadLossPolynomialDegree() << std::endl;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment