Skip to content
Snippets Groups Projects
Commit 9040640b authored by Julien Michel's avatar Julien Michel
Browse files

MRG

parents ca7a1e4f 9b6db517
Branches
Tags
No related merge requests found
......@@ -339,53 +339,54 @@ ImageFileReader<TOutputImage>
bool hasMetaData = false;
ossimKeywordlist geom_kwl, tmp_kwl, tmp_kwl2;// = new ossimKeywordlist();
// Add the radar factory
ossimImageHandlerRegistry::instance()->addFactory(ossimImageHandlerSarFactory::instance());
ossimImageHandler* handler = ossimImageHandlerRegistry::instance()
->open(ossimFilename(lFileNameOssimKeywordlist.c_str()));
if (!handler)
{
otbMsgDevMacro( <<"OSSIM Open Image FAILED ! ");
}
else
{
otbMsgDevMacro( <<"OSSIM Open Image SUCCESS ! ");
// hasMetaData = handler->getImageGeometry(geom_kwl);
ossimProjection* projection = handler->getImageGeometry()->getProjection();
if (projection)
{
hasMetaData = projection->saveState(geom_kwl);
}
}
// Free memory
delete handler;
if (!hasMetaData)
{
// Add the plugins factory
ossimProjectionFactoryRegistry::instance()->registerFactory(ossimplugins::ossimPluginProjectionFactory::instance());
ossimProjection * projection = ossimProjectionFactoryRegistry::instance()
->createProjection(ossimFilename(lFileNameOssimKeywordlist.c_str()), 0);
if (!projection)
// Test the plugins factory
/** Before, the pluginfactory was tested if the ossim one returned false.
But in the case TSX, the images tif were considered as ossimQuickbirdTiffTileSource
thus a TSX tif image wasn't read with TSX Model. We don't use the ossimRegisteryFactory
because the default include factory contains ossimQuickbirdTiffTileSource. */
ossimProjection * projection = ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(ossimFilename(lFileNameOssimKeywordlist.c_str()), 0);
if (!projection)
{
otbMsgDevMacro( <<"OSSIM Instantiate projection FAILED ! ");
}
else
else
{
otbMsgDevMacro( <<"OSSIM Instantiate projection SUCCESS ! ");
hasMetaData = projection->saveState(geom_kwl);
// Free memory
delete projection;
}
}
if (!hasMetaData)
{
{
// Add the radar factory
ossimImageHandlerRegistry::instance()->addFactory(ossimImageHandlerSarFactory::instance());
ossimImageHandler* handler = ossimImageHandlerRegistry::instance()->open(ossimFilename(lFileNameOssimKeywordlist.c_str()));
if (!handler)
{
otbMsgDevMacro( <<"OSSIM Open Image FAILED ! ");
}
else
{
otbMsgDevMacro( <<"OSSIM Open Image SUCCESS ! ");
// hasMetaData = handler->getImageGeometry(geom_kwl);
ossimProjection* projection = handler->getImageGeometry()->getProjection();
if (projection)
{
hasMetaData = projection->saveState(geom_kwl);
}
}
// Free memory
delete handler;
}
if (!hasMetaData)
{
otbMsgDevMacro( <<"OSSIM MetaData not present ! ");
}
else
......
......@@ -41,9 +41,10 @@ namespace otb
template <class TInputImage, class TOutputImage >
class ITK_EXPORT TerraSarBrightnessImageFilter :
public itk::UnaryFunctorImageFilter<
TInputImage,
TOutputImage,
ITK_TYPENAME Functor::TerraSarBrightnessImageFunctor< ITK_TYPENAME TInputImage::InternalPixelType, ITK_TYPENAME TOutputImage::InternalPixelType > >
TInputImage,
TOutputImage,
ITK_TYPENAME Functor::TerraSarBrightnessImageFunctor< ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TInputImage::InternalPixelType>::ValueType,
ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TOutputImage::InternalPixelType>::ValueType > >
{
public:
/** Extract input and output images dimensions.*/
......@@ -53,8 +54,12 @@ public:
/** "typedef" to simplify the variables definition and the declaration. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename Functor::TerraSarBrightnessImageFunctor<ITK_TYPENAME TInputImage::InternalPixelType,
ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType;
typedef typename InputImageType::InternalPixelType InputInternalPixelType;
typedef typename OutputImageType::InternalPixelType OutputInternalPixelType;
typedef typename itk::NumericTraits<InputInternalPixelType>::ValueType InputValueType;
typedef typename itk::NumericTraits<OutputInternalPixelType>::ValueType OutputValueType;
typedef typename Functor::TerraSarBrightnessImageFunctor< InputValueType, OutputValueType> FunctorType;
/** "typedef" for standard classes. */
typedef TerraSarBrightnessImageFilter Self;
typedef itk::UnaryFunctorImageFilter< InputImageType, OutputImageType, FunctorType >
......
......@@ -50,7 +50,8 @@ class ITK_EXPORT TerraSarCalibrationImageFilter :
public UnaryFunctorWithIndexImageFilter<
TInputImage,
TOutputImage,
ITK_TYPENAME Functor::TerraSarCalibrationImageFunctor< ITK_TYPENAME TInputImage::InternalPixelType, ITK_TYPENAME TOutputImage::InternalPixelType > >
ITK_TYPENAME Functor::TerraSarCalibrationImageFunctor< ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TInputImage::InternalPixelType>::ValueType,
ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TOutputImage::InternalPixelType>::ValueType > >
{
public:
/** Extract input and output images dimensions.*/
......@@ -58,10 +59,14 @@ public:
itkStaticConstMacro( OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
/** "typedef" to simplify the variables definition and the declaration. */
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename Functor::TerraSarCalibrationImageFunctor<ITK_TYPENAME InputImageType::InternalPixelType,
ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType;
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename InputImageType::InternalPixelType InputInternalPixelType;
typedef typename OutputImageType::InternalPixelType OutputInternalPixelType;
typedef typename itk::NumericTraits<InputInternalPixelType>::ValueType InputValueType;
typedef typename itk::NumericTraits<OutputInternalPixelType>::ValueType OutputValueType;
typedef typename Functor::TerraSarCalibrationImageFunctor< InputValueType, OutputValueType> FunctorType;
/** "typedef" for standard classes. */
typedef TerraSarCalibrationImageFilter Self;
typedef UnaryFunctorWithIndexImageFilter< InputImageType, OutputImageType, FunctorType > Superclass;
......
......@@ -22,10 +22,15 @@
int otbTerraSarBrightnessImageFilterNew(int argc, char * argv[])
{
typedef otb::Image<double, 2> ImageType;
typedef otb::TerraSarBrightnessImageFilter<ImageType, ImageType> FilterType;
typedef otb::Image<double, 2> ImageType;
typedef otb::Image<std::complex<double>, 2> ComplexImageType;
typedef otb::TerraSarBrightnessImageFilter<ImageType, ImageType> FilterType;
typedef otb::TerraSarBrightnessImageFilter<ComplexImageType, ComplexImageType> ComplexFilterType;
FilterType::Pointer filter = FilterType::New();
ComplexFilterType::Pointer complexFilter = ComplexFilterType::New();
return EXIT_SUCCESS;
}
......@@ -22,10 +22,14 @@
int otbTerraSarCalibrationImageFilterNew(int argc, char * argv[])
{
typedef otb::Image<double, 2> ImageType;
typedef otb::TerraSarCalibrationImageFilter<ImageType, ImageType> FilterType;
typedef otb::Image<double, 2> ImageType;
typedef otb::Image<std::complex<double>, 2> ComplexImageType;
typedef otb::TerraSarCalibrationImageFilter<ImageType, ImageType> FilterType;
typedef otb::TerraSarCalibrationImageFilter<ComplexImageType, ComplexImageType> ComplexFilterType;
FilterType::Pointer filter = FilterType::New();
ComplexFilterType::Pointer complexFilter = ComplexFilterType::New();
return EXIT_SUCCESS;
}
......@@ -36,14 +36,14 @@ ossimPluginProjectionFactory* ossimPluginProjectionFactory::instance()
ossimProjection* ossimPluginProjectionFactory::createProjection(
const ossimFilename& filename, ossim_uint32 /*entryIdx*/)const
{
ossimRefPtr<ossimProjection> result = 0;
ossimRefPtr<ossimProjection> result = 0;
if ( !result )
{
ossimRefPtr<ossimRadarSat2Model> model = new ossimRadarSat2Model();
if ( model->open(filename) )
{
result = model.get();
result = model.get();
}
else
{
......@@ -54,7 +54,8 @@ ossimProjection* ossimPluginProjectionFactory::createProjection(
if ( !result )
{
ossimRefPtr<ossimTerraSarModel> model = new ossimTerraSarModel();
if ( model->open(filename) )
if ( model->open(filename) )
{
result = model.get();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment