23 #include <itkImageRegionIteratorWithIndex.h> 24 #include <itkNeighborhoodIterator.h> 30 struct GIFLocalIntensityParameter
37 template<
typename TPixel,
unsigned int VImageDimension>
41 typedef itk::Image<TPixel, VImageDimension>
ImageType;
42 typedef itk::Image<unsigned short, VImageDimension> MaskType;
44 typename MaskType::Pointer itkMask = MaskType::New();
47 double range = params.range;
50 filter->SetInput(itkImage);
51 filter->SetMask(itkMask);
52 filter->SetRange(range);
55 featureList.push_back(std::make_pair(params.prefix +
"2. Local Intensity Peak", filter->GetLocalPeak()));
56 featureList.push_back(std::make_pair(params.prefix +
"2. Global Intensity Peak", filter->GetGlobalPeak()));
71 if (image->GetDimension() < 3)
75 GIFLocalIntensityParameter params;
104 if (parsedArgs.count(name +
"::range"))
106 double range =
us::any_cast<
float>(parsedArgs[name +
"::range"]);
109 MITK_INFO <<
"Start calculating local intensity features ....";
111 featureList.insert(featureList.end(), localResults.begin(), localResults.end());
112 MITK_INFO <<
"Finished calculating local intensity features....";
118 std::ostringstream ss;
120 std::string strRange = ss.str();
121 return "Range-" + ss.str();
#define AccessByItk_3(mitkImage, itkImageTypeFunction, arg1, arg2, arg3)
void AddArguments(mitkCommandLineParser &parser) override
std::vector< std::string > FeatureNameListType
itk::Image< unsigned char, 3 > ImageType
virtual void SetLongName(std::string _arg)
static void CalculateIntensityPeak(itk::Image< TPixel, VImageDimension > *itkImage, mitk::Image::Pointer mask, mitk::GIFLocalIntensity::FeatureListType &featureList, GIFLocalIntensityParameter params)
ValueType * any_cast(Any *operand)
void addArgument(const std::string &longarg, const std::string &shortarg, Type type, const std::string &argLabel, const std::string &argHelp=std::string(), const us::Any &defaultValue=us::Any(), bool optional=true, bool ignoreRest=false, bool deprecated=false, mitkCommandLineParser::Channel channel=mitkCommandLineParser::Channel::None)
virtual void SetShortName(std::string _arg)
std::vector< std::pair< std::string, double > > FeatureListType
std::string FeatureDescriptionPrefix()
Returns a string that encodes the feature class name.
virtual std::string GetLongName() const
std::string GetOptionPrefix() const
void CalculateFeaturesUsingParameters(const Image::Pointer &feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override
Calculates the feature of this abstact interface. Does not necessarily considers the parameter settin...
mitk::Image::Pointer image
virtual double GetRange() const
virtual void SetRange(double _arg)
virtual void SetFeatureClassName(std::string _arg)
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
std::string GetCurrentFeatureEncoding() override
Adds an additional Separator to the name of the feature, which encodes the used parameters.
mitk::Image::Pointer mask
FeatureNameListType GetFeatureNames() override
Returns a list of the names of all features that are calculated from this class.
FeatureListType CalculateFeatures(const Image::Pointer &image, const Image::Pointer &feature) override
Calculates the Cooccurence-Matrix based features for this class.
virtual ParameterTypes GetParameter() const