Skip to content
Snippets Groups Projects
Commit 80578511 authored by Peter Kettig's avatar Peter Kettig
Browse files

Merged branch various_fixes into develop

parents 12ba50d2 6759159a
No related branches found
No related tags found
1 merge request!3Various fixes
Showing
with 70 additions and 8 deletions
......@@ -89,7 +89,7 @@ public:
}
private:
int m_MasksArray[8] = {0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64, 0x128};
int m_MasksArray[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
int m_bit;
};
......
......@@ -28,7 +28,6 @@
#ifndef COMPOSITEPREPROCESSING_INCLUDE_PREPROCESSINGADAPTER_H_
#define COMPOSITEPREPROCESSING_INCLUDE_PREPROCESSINGADAPTER_H_
#include "itkLightObject.h"
#include "otbImage.h"
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
......@@ -47,11 +46,17 @@ namespace ts {
*/
namespace preprocessing {
class PreprocessingAdapter : public itk::LightObject, public BaseImageTypes{
class PreprocessingAdapter : public BaseImageTypes{
public:
typedef MaskExtractorFilter<ByteImageType,FloatImageType> ExtractorFilterType;
typedef otb::ObjectList<ExtractorFilterType> ExtractorListType;
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
void init(){
m_MaskList = ByteImageReaderListType::New();
m_ExtractorList = ExtractorListType::New();
......
......@@ -46,6 +46,12 @@ namespace preprocessing {
class PreprocessingSentinel : public PreprocessingAdapter {
public:
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
/**
* @brief Extract the muscate cloud mask of Sentinel
* @param filename The filename of the input file
......
......@@ -45,6 +45,12 @@ namespace preprocessing {
class PreprocessingVenus : public PreprocessingAdapter {
public:
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
/**
* @brief Extract the muscate cloud mask of Venus
* @param filename The filename of the input file
......
......@@ -90,8 +90,10 @@ private:
MandatoryOff("scatteringcoeffsr2");
AddParameter(ParameterType_OutputImage, "outr1", "Out Image at R1 resolution");
MandatoryOff("outr1");
SetDefaultOutputPixelType("outr1", ImagePixelType_int16);
AddParameter(ParameterType_OutputImage, "outr2", "Out Image at R2 resolution");
MandatoryOff("outr2");
SetDefaultOutputPixelType("outr2", ImagePixelType_int16);
AddParameter(ParameterType_OutputImage, "outcld", "Out cloud mask image R1 resolution");
MandatoryOff("outcld");
AddParameter(ParameterType_OutputImage, "outwat", "Out water mask image R1 resolution");
......@@ -192,7 +194,6 @@ private:
if(!parameter.empty() && totalNRes < size_t(N_RESOLUTIONS_SENTINEL)){
itkExceptionMacro("Cannot set parameter " << parameterStr << " for a Platform with less than 2 resolutions");
}
m_processor.release();
}
private:
......
......@@ -29,6 +29,11 @@
using namespace ts::preprocessing;
const char * PreprocessingAdapter::GetNameOfClass() const
{
return "PreprocessingAdapter";
}
PreprocessingAdapter::FloatImageType::Pointer PreprocessingAdapter::getFloatMask(const std::string &filename, const unsigned char &bit){
ExtractorFilterType::Pointer extractor = ExtractorFilterType::New();
extractor->SetBitMask(bit);
......
......@@ -34,6 +34,11 @@
using namespace ts::preprocessing;
const char * PreprocessingSentinel::GetNameOfClass() const
{
return "PreprocessingSentinel";
}
PreprocessingAdapter::FloatImageType::Pointer PreprocessingSentinel::getCloudMask(const std::string &filename, const unsigned char &bit){
return getFloatMask(filename, bit);
}
......
......@@ -32,6 +32,11 @@
using namespace ts::preprocessing;
const char * PreprocessingVenus::GetNameOfClass() const
{
return "PreprocessingVenus";
}
PreprocessingAdapter::FloatImageType::Pointer PreprocessingVenus::getCloudMask(const std::string &filename, const unsigned char &bit){
return getFloatMask(filename, bit);
}
......
......@@ -34,7 +34,7 @@
#include "ProductDefinitions.h"
#include "BaseImageTypes.h"
#include "VectorImageSplitter.h"
#include "itkLightObject.h"
#include "otbVectorImageToImageListFilter.h"
/**
* @brief The TemporalSynthesis namespace, covering all needed functions to execute this processing chain
......@@ -44,8 +44,14 @@ namespace ts {
/**
* @brief Adapter for all Product-formatters of each platform
*/
class ProductCreatorAdapter : public itk::LightObject, public BaseImageTypes{
class ProductCreatorAdapter : public BaseImageTypes{
public:
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
/**
* @brief Initialize a ProductFormatter
* @param products The input product filenames
......
......@@ -37,6 +37,11 @@ namespace ts {
class ProductCreatorSentinelMuscate : public ProductCreatorAdapter{
public:
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
/**
* @brief Create a Sentinel-2 Muscate product inside the specified destination-folder
......
......@@ -38,6 +38,11 @@ namespace ts {
class ProductCreatorVenusMuscate : public ProductCreatorAdapter{
public:
/**
* @brief Get the name of this class
* @return the class name
*/
virtual const char * GetNameOfClass() const;
/**
* @brief Create a Venus Muscate product inside the specified destination-folder
......
......@@ -37,6 +37,11 @@
using namespace ts;
const char * ProductCreatorAdapter::GetNameOfClass() const
{
return "ProductCreatorAdapter";
}
void ProductCreatorAdapter::FillMetadataInfo(std::shared_ptr<MuscateFileMetadata> &metadata)
{
m_tileID = metadata->DatasetIdentification.GeographicalZone;
......
......@@ -33,6 +33,11 @@
using namespace ts;
const char * ProductCreatorSentinelMuscate::GetNameOfClass() const
{
return "ProductCreatorSentinelMuscate";
}
bool ProductCreatorSentinelMuscate::createProduct(const std::string &destination){
m_strDestRoot = destination;
std::cout << "Sentinel ProductFormatter: " << destination << std::endl;
......
......@@ -31,6 +31,11 @@
using namespace ts;
const char * ProductCreatorVenusMuscate::GetNameOfClass() const
{
return "ProductCreatorVenusMuscate";
}
bool ProductCreatorVenusMuscate::createProduct(const std::string &destination){
m_strDestRoot = destination;
std::cout << "Venus ProductFormatter: " << destination << std::endl;
......
......@@ -145,8 +145,6 @@ private:
if(m_creator->createProduct(destination) == false){
itkExceptionMacro("Error in product creation of " << destination);
}
m_creator.release(); //needed as otherwise ITK will throw a warning about deletion of a still-referenced object
return;
}
/**
......
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