This file is indexed.

/usr/include/mia-2.2/mia/core/cost.hh is in libmia-2.2-dev 2.2.2-1+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* -*- mia-c++  -*-
 *
 * This file is part of MIA - a toolbox for medical image analysis 
 * Copyright (c) Leipzig, Madrid 1999-2014 Gert Wollny
 *
 * MIA is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef mia_core_cost_hh
#define mia_core_cost_hh

#include <mia/core/factory.hh>
#include <mia/core/refholder.hh>


#ifndef EXPORT_HANDLER
#  ifdef WIN32
#     define EXPORT_HANDLER __declspec(dllimport)
#  else
#     define EXPORT_HANDLER
#  endif
#endif

NS_MIA_BEGIN

/// plugin helper type
struct EXPORT_CORE cost_type {
	/// plugin path helper variable 
	static const char *type_descr;
};


/**
   \ingroup registration 

   \brief The generic cost function interface. 

   The class defines an abstract interface for a cost function between two entities of the same 
   type. 
   The pure virtual functions 
    -double do_value(const T& a, const T& b) const, and 
    -double do_evaluate_force(const T& a, const T& b, float scale, V& force) const
    have to be implemented in the derived class to make it a real cost function. 
    The virtual function 
    - void post_set_reference(const T& ref)
    may be overwritten in order to prepare the reference data for the implemented cost function.
    \tparam T the data type of the objects that the cost evaluation is based on 
    \tparam V the type of the gradient force field created by this cost function 
*/

template <typename T, typename V>
class EXPORT_HANDLER TCost : public CProductBase{
public:
	/// typedef for generic programming: The data type used by the cost function 
	typedef T Data;
	
	/// typedef for generic programming: The gradient forca type create by the cost function 
	typedef V Force;

	/// Const reference holder TRefHolder of the cost function data 
	typedef TRefHolder<T> RData; 
	
	/// Pointer to const reference holder TRefHolder of the cost function data 
	typedef typename RData::Pointer PData;

	/// plugin searchpath helper type 
	typedef T plugin_data; 
	
	/// plugin searchpath helper type 
	typedef cost_type plugin_type; 

	/// ensure virtual destruction, since we have virtual functions
	virtual ~TCost();

	/**
	   Evaluate the value of the cost function petreen the given src image and 
	   the reference that was set by calling set_reference(const T& ref). 
	   \param src 
	   \returns the cost function value 
	 */
	double value(const T& src) const;


	/**
	   Evaluate the value of the cost function and its gradient with respect 
	   to the given src image and  the reference that was set by 
           calling set_reference(const T& ref). 
	   \param src 
	   \param[out] force gradient force 
	   \returns the cost function value 
	 */
	double evaluate_force(const T& src, V& force) const;
	
	/**
	   Set the new reference of the cost function. The virtual private function  
	   post_set_reference(const T& ref) is then called to run possible preparations 
	   on the reference image. 
	 */
	void set_reference(const T& ref);
private:
	virtual double do_value(const T& a, const T& b) const = 0;
	virtual double do_evaluate_force(const T& a, const T& b, V& force) const = 0;
	virtual void post_set_reference(const T& ref); 
	
	PData m_reference; 
};

NS_MIA_END
#endif