<commit_before>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#ifndef _MITKPHOTOACOUSTICSBMODEFILTER_H_
#define _MITKPHOTOACOUSTICSBMODEFILTER_H_

#if defined(PHOTOACOUSTICS_USE_GPU) || DOXYGEN
#include "mitkOclDataSetToDataSetFilter.h"
#endif

#include <itkObject.h>
#include "mitkImageToImageFilter.h"

namespace mitk
{
  #if defined(PHOTOACOUSTICS_USE_GPU) || DOXYGEN

  //##Documentation
  //## @brief
  //## @ingroup Process

  class PhotoacousticOCLBModeFilter : public OclDataSetToDataSetFilter, public itk::Object
  {

  public:
    mitkClassMacroItkParent(PhotoacousticOCLBModeFilter, itk::Object);
    itkNewMacro(Self);

    //##Description
    //## @brief Time when Header was last initialized
    void SetInput(Image::Pointer image);

    /** Update the filter */
    void Update();

    void SetParameters(bool useLogFilter)
    {
      m_UseLogFilter = useLogFilter;
    }    
    
    /**
     * @brief GetOutputAsImage Returns an mitk::Image constructed from the processed data
     */
    mitk::Image::Pointer GetOutput();

  protected:

    PhotoacousticOCLBModeFilter();

    virtual ~PhotoacousticOCLBModeFilter();

    bool Initialize();

    void Execute();

    mitk::PixelType GetOutputType()
    {
      return mitk::MakeScalarPixelType<float>();
    }

    int GetBytesPerElem()
    {
      return sizeof(float);
    }

    virtual us::Module* GetModule();

  private:
    /** The OpenCL kernel for the filter */
    cl_kernel m_PixelCalculation;
    bool m_UseLogFilter;

    mitk::Image::Pointer m_InputImage;
    unsigned int m_InputDim[3];
    unsigned int m_Size;

  };
  #endif

  class PhotoacousticBModeFilter : public ImageToImageFilter
  {
  public:
    mitkClassMacro(PhotoacousticBModeFilter, ImageToImageFilter);

    itkFactorylessNewMacro(Self)
    itkCloneMacro(Self)

    void SetParameters(bool useLogFilter)
    {
      m_UseLogFilter = useLogFilter;
    }

  protected:

    PhotoacousticBModeFilter();

    ~PhotoacousticBModeFilter();

    virtual void GenerateInputRequestedRegion() override;<commit_msg>Added documentation for the BMode filter class. In thr Photoacoustic Algorithms module every class has now a detailed doxygen documentation.<commit_after>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#ifndef _MITKPHOTOACOUSTICSBMODEFILTER_H_
#define _MITKPHOTOACOUSTICSBMODEFILTER_H_

#if defined(PHOTOACOUSTICS_USE_GPU) || DOXYGEN
#include "mitkOclDataSetToDataSetFilter.h"
#endif

#include <itkObject.h>
#include "mitkImageToImageFilter.h"

namespace mitk
{
  #if defined(PHOTOACOUSTICS_USE_GPU) || DOXYGEN

  /*!
  * \brief Class implementing a mitk::OclDataSetToDataSetFilter for BMode filtering on GPU
  *
  *  The only parameter that needs to be provided is whether it should use a logfilter.
  *  Currently this class only performs an absolute BMode filter.
  */
  class PhotoacousticOCLBModeFilter : public OclDataSetToDataSetFilter, public itk::Object
  {

  public:
    mitkClassMacroItkParent(PhotoacousticOCLBModeFilter, itk::Object);
    itkNewMacro(Self);

    /** \brief Set the input image to be processed
    */
    void SetInput(Image::Pointer image);

    void Update();

    /** \brief Set parameters for the filter
    *
    * @param useLogFilter If true, the filter will apply a logfilter on the processed image
    */
    void SetParameters(bool useLogFilter)
    {
      m_UseLogFilter = useLogFilter;
    }    
    
    /**
     * @brief GetOutput Returns an mitk::Image constructed from the processed data
     */
    mitk::Image::Pointer GetOutput();

  protected:

    PhotoacousticOCLBModeFilter();

    virtual ~PhotoacousticOCLBModeFilter();

    bool Initialize();

    void Execute();

    mitk::PixelType GetOutputType()
    {
      return mitk::MakeScalarPixelType<float>();
    }

    int GetBytesPerElem()
    {
      return sizeof(float);
    }

    virtual us::Module* GetModule();

  private:
    /** The OpenCL kernel for the filter */
    cl_kernel m_PixelCalculation;
    bool m_UseLogFilter;

    mitk::Image::Pointer m_InputImage;
    unsigned int m_InputDim[3];
    unsigned int m_Size;

  };
  #endif

  /*!
  * \brief Class implementing a mitk::ImageToImageFilter for BMode filtering on CPU
  *
  *  The only parameter that needs to be provided is whether it should use a logfilter.
  *  Currently this class only performs an absolute BMode filter.
  */
  class PhotoacousticBModeFilter : public ImageToImageFilter
  {
  public:
    mitkClassMacro(PhotoacousticBModeFilter, ImageToImageFilter);

    itkFactorylessNewMacro(Self)
    itkCloneMacro(Self)

    /** \brief Set parameters for the filter
    *
    * @param useLogFilter If true, the filter will apply a logfilter on the processed image
    */
    void SetParameters(bool useLogFilter)
    {
      m_UseLogFilter = useLogFilter;
    }

  protected:

    PhotoacousticBModeFilter();

    ~PhotoacousticBModeFilter();

    virtual void GenerateInputRequestedRegion() override;
{'fraction_non_alphanumeric': 0.12253979120314906, 'fraction_numerical': 0.0003422899195618689, 'mean_word_length': 3.9693877551020407, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6893089', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1663, 'n_words': 467}