This file is indexed.

/usr/include/mia-2.2/mia/2d/segframe.hh is in libmia-2.2-dev 2.2.7-3.

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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/* -*- mia-c++  -*-
 *
 * This file is part of MIA - a toolbox for medical image analysis 
 * Copyright (c) Leipzig, Madrid 1999-2015 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 SegFrame_h
#define SegFrame_h

#include <vector>
#include <mia/2d/segstar.hh>
#include <mia/2d/segsection.hh>
#include <mia/2d/image.hh>

NS_MIA_BEGIN

/**
   @ingroup perf 
   \brief A class to represent one segmented frame in a heart perfusion series 
   
   This class implements the frame of a myocardial segmentation consisting of 
   six sections CSegsection, the segmentation helper CSegStar, and the name of the 
   corresponding image file.  
*/
class  EXPORT_2D CSegFrame {
public:
	/// convenience typedef for the sections 
	typedef std::vector<CSegSection> Sections;
	
	/** convenience typedef for the statistics values  
	    @remark maybe a type with more meaningful elements would be better 
	 */ 
	typedef std::pair<float, float> Statistics; 
	
	/// convenience typedef for the section statistics vector 
	typedef std::vector<Statistics> SectionsStats; 
	
	
	CSegFrame();

	/**
	   Construct the segmentation frame from 
	   \param image image file name 
	   \param star CSegStar 
	   \param sections the segmentation sections 
	 */
	CSegFrame(const std::string& image, const CSegStar& star, const Sections& sections);

	/**
	   Construct the segmentation frame from a XML root node
	   \param node
	   \param version segmentation set version the node stems from. 
	 */
	CSegFrame(const xmlpp::Node& node, int version);

	/// \returns the file name of the corresponding image 
	const std::string& get_imagename() const;

	/** set the file name of the corresponding image 
	    \param name 
	 */
	void set_imagename(const std::string& name);

	/** rename the file name base of the image according to 
	    sed -e "s/.*[^0-9]\([0-9]*\..*\)/$new_base\1/"
	    \param new_base
	 */
	void rename_base(const std::string& new_base); 

	/// \returns a read-only reference to the segmentation sections 
	const Sections& get_sections() const;

	/**
	   Set the image corresponding to the segmentation frame 
	   @param image 
	 */
	void set_image(P2DImage image); 

	/**
	   @returns the star of the LV contained in this frame 
	 */
	const CSegStar& get_star() const;

	/// @returns the bounding box enclosing all segmentation sections belonging to thie frame 
	const C2DBoundingBox get_boundingbox() const;


	/**
	   Append the segmentation frame to a XML node 
	   @param node parent node to append the frame description to 
	   @param version segmentation set file version that should be used to save the data
	 */
	void write(xmlpp::Node& node, int version) const;

	/**
	   Shift the segmentation frame and change the file name to the new name 
	   corresponding to the shifted image 
	   @param delta translation 
	   @param cropped_file new image file name 
	*/
	void shift(const C2DFVector& delta, const std::string& cropped_file);


	/**
	   transform the frame segmentation by a given transformation 
	   @param t 
	 */
	void transform(const C2DTransformation& t);

	/**
	   transform the frame segmentation by the inverse of the given transformation 
	   @param t 
	 */
	void inv_transform(const C2DTransformation& t);

	/**
	   Evaluate the Hausdorff distance of this segmentation frame to another 
	   @param other 
	   @returns Hausdorff distance
	 */
	float get_hausdorff_distance(const CSegFrame& other) const;


	/**
	   Evaluate a mask image based on the segmented sections
	   @param size size of the output image 
	   @returns an image containing the masks for each section  numbered in the storage 
	   order of the sections
	   @remark If overlap exists between the sections the masks with a higher index overwrite 
	   the masks with a lower index. 
	 */
	C2DUBImage get_section_masks(const C2DBounds& size) const; 

	/**
	   Create the section masks by using the size of the image corresponding to the frame 
	   @returns the mask image, for details see get_section_masks(const C2DBounds& size). 
	 */
	C2DUBImage get_section_masks() const; 

	/**
	   Create the section masks by using the size of the image corresponding to the frame. 
	   If the number of requested sections is equal to the number of sections stored, this 
	   call is equal to get_section_masks(), 
           Otherwiese, instead of using the sections as defined, evaluate the union of all the sections 
	   and then split this union evenly in \a n_sections starting by the first directional ray 
	   and moving clockwiese with the star center as the angular point. 
	   @param n_sections number of target sections 
	   @returns the mask image, for details see get_section_masks(const C2DBounds& size). 
	 */
	C2DUBImage get_section_masks(size_t n_sections) const; 


	/**
	   Evaluate inetnsity mean and variation of the image data for the registions  
	   defined by the given mask image. 
	   @param mask 
	   @returns the statustics 
	 */
	SectionsStats get_stats(const C2DUBImage& mask) const; 
	
	/**
	   Evaluate inetnsity mean and variation of the image data for the registions  
	   defined the get_section_masks(size_t n_sections) method. 
	   @param n_sections 
	   @returns the statustics 
	 */
	SectionsStats get_stats(size_t n_sections) const; 

	/**
	   \returns number of segmented sections 
	 */
	size_t get_nsections() const; 

	/**
	   \returns slice quality rating 
	 */
	float get_quality() const; 

	/**
	   \returns proposed brightness correction 
	 */
	float get_brightness() const; 
	
         /**
	    \returns proposed contrast correction 
	 */
	float get_contrast() const; 


	/**
	   set the quality rating for the frame 
	   \param q 0=not set, 1-5 worst to best 
	 */
	void set_quality(float q); 

	/**
	   set the brightness adjustment for the frame 
	   \param b 0=no adjustment 
	 */
	void set_brightness(float b); 
	
         /**
	    set contrast adjustment 
	    \param c 0=no adjustment 
	 */
	void set_contrast(float c); 
	
private:
	void load_image() const; 

	bool m_has_star;
	CSegStar m_star;
	Sections m_sections;
	std::string m_filename;
	mutable P2DImage m_image; 

	float m_quality; 
	float m_brightness; 
	float m_contrast; 
	int m_version; 
};

NS_MIA_END

#endif