This file is indexed.

/usr/include/mia-2.2/mia/3d/2dimagefifofilter.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/* -*- 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_2dfifofilterstack_hh
#define __mia_2dfifofilterstack_hh

#include <mia/2d/image.hh>
#include <mia/3d/image.hh>
#include <mia/core/factory.hh>
#include <mia/core/fifofilter.hh>
#include <mia/core/filter.hh>
#include <mia/2d/image.hh>

NS_MIA_BEGIN

/** @cond INTERNAL
    \brief type for combiner plug-in path handling 
 */

struct EXPORT_3D image2d_stack {
	static const char *data_descr;
};

/**
   \ingroup traits
   \brief an instanciation of the __copy_create_ptr for C2DImage 
   
   This trait is used to copy a C2DImage and return it as a P2DImage shared pointer.  
*/
template <>
struct __copy_create_ptr<C2DImage> {
	static P2DImage apply(const C2DImage& x){
		return P2DImage(x.clone());
	}
};
/// @endcond 

/**
   \ingroup filtering 
   \brief The class to provide filtering of series of 2D images as if they where 3D images 

   This class is the base class for filters that run on series of 2D images in a 3D manner 
   offering out-of-core processing. Specifically, each derived filter should only hold 
   as much data as abolutely neccessary to filter a block of 2D images in a 3D manner. 
   Therefore, only spacial, non-iterative filter can be implementes to be used in this 
   FIFO filtering framework.
   This base class takes care of the data handling needed for out-of-core processing. 
*/


class EXPORT_3D C2DImageFifoFilter: public TFifoFilter<P2DImage>, public CProductBase  {
public:
	typedef image2d_stack plugin_data; 
	typedef filter_type plugin_type; 

	/**
	   Constructor of the FIFO filter. The given parameters describe what amount of memory is needed 
	   for the filter to work properly. Thes parameters are passed directly to the parent class. 
	   \param filter_width actual filter width in Z-direction (i.e. the number of slices used 
	   to evaluate the filter at a certain point. 
	   \param min_fill minimum number of slices required before the filter does actual processing 
	   \param read_start number of slices that have to be pushed into the filter before first results can be read. 
	*/
	C2DImageFifoFilter(size_t filter_width, size_t min_fill, size_t read_start);
protected:

	/**
	   Create the 3D buffer that is needed to hold the amount of data required for the filter 
	   \param slice_sice size of the 2D images to be puhsed down the pipeline 
	   \param depth number of slices to be hold for processing (this may be different from filter width 
	   \param type pixel type to be used for the buffer
	*/
	C3DImage *create_buffer(const C2DBounds& slice_sice, size_t depth, EPixelType type);

	/**
	   @cond INTERNAL 
	   \ingroup Filtering 
	   \brief helper class to dispatch the shift of the slices in the FIFO  buffer based on the pixel type
	*/
	struct CShiftSlices: public TFilter<int> {
		template <typename T>
		int operator ()(T3DImage<T>& input) const
		{
			copy_backward(input.begin(), input.end() - input.get_size().x
				      * input.get_size().y , input.end());
			return 0;
		}
	};
	///@endcond 
};

/**
   \ingroup filtering
   \brief The plug-in base class for the FIFO filters 
*/
class EXPORT_3D C2DFifoFilterPlugin:
	public TFactory<C2DImageFifoFilter> {
protected:
	/**
	   Plugin constructor
	   \param name Name of the filter 
	 */
	C2DFifoFilterPlugin(char const * const  name);

	/// helper class to store a set of images 
	typedef std::vector<P2DImage> CImageStack;

	/**
	   Helper function to run tests on stack filters
	   \param in_data the input data 
	   \param test_data the expected filter result 
	   \param filter the filter to be run (usually the same as handled by the plug-in 
	   \returns true if the filter provided the expected results, false otherwiese  
	   \remark this should be a stand-alone function that is implemented in the test library 
	*/
	bool call_test(const CImageStack& in_data, const CImageStack& test_data,
		       C2DImageFifoFilter& filter)const ;
};

/**
   \ingroup filtering
   \brief Pointer type for the FIFO filter 
*/
typedef TFifoFilter<P2DImage>::Pointer P2DImageFifoFilter;

/**
   \ingroup filtering
   \brief Plugin handler for the FIFO filters 
*/
typedef THandlerSingleton<TFactoryPluginHandler<C2DFifoFilterPlugin> > C2DFifoFilterPluginHandler;

NS_MIA_END

#endif