Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
visualize.hxx
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2016 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 // File : visualize.hxx
30 // Author : Pavel A. Koshevoy
31 // Created : 2006/04/05 11:09
32 // Copyright : (C) 2004-2008 University of Utah
33 // Description : Helper functions for visualizing unmatched
34 // and matched SIFT keys and descriptors.
35 
36 #ifndef VISUALIZE_HXX_
37 #define VISUALIZE_HXX_
38 
39 // local includes:
40 #include <Core/ITKCommon/extrema.hxx>
41 #include <Core/ITKCommon/pyramid.hxx>
42 #include <Core/ITKCommon/match.hxx>
43 #include <Core/ITKCommon/common.hxx>
44 #include <Core/ITKCommon/draw.hxx>
45 
46 // ITK includes:
47 #include <itkVector.h>
48 
49 // system includes:
50 #include <list>
51 #include <vector>
52 #include <string>
53 
54 
55 //----------------------------------------------------------------
56 // draw_feature_key
57 //
58 extern void
59 draw_feature_key(native_image_t::Pointer * image,
60  const double & x0,
61  const double & y0,
62  const double & direction,
63  const double & radius,
64  const xyz_t & color);
65 
66 //----------------------------------------------------------------
67 // draw_feature_vector
68 //
69 // x0, y0 are expressed in physical coordinates:
70 //
71 extern void
72 draw_feature_vector(native_image_t::Pointer * image,
73  double x0,
74  double y0,
75  const double & direction,
76  const xyz_t & color,
77  const std::vector<double> & feature,
78  double scale = 1.0);
79 
80 //----------------------------------------------------------------
81 // draw_keys
82 //
83 extern void
84 draw_keys(native_image_t::Pointer * image,
85  const std::list<descriptor_t> & keys,
86  const xyz_t & rgb,
87  const double & r0,
88  const double & r1,
89  const unsigned int octave = 0);
90 
91 //----------------------------------------------------------------
92 // visualize_matches
93 //
94 // visualize the matching keys:
95 //
96 extern void
97 visualize_matches(const pyramid_t & a,
98  const pyramid_t & b,
99  const unsigned int & io, // octave index
100  const unsigned int & is, // scale index
101  const std::list<match_t> & ab,
102  const bfs::path & fn_prefix,
103  unsigned int num_keys = ~0);
104 
105 //----------------------------------------------------------------
106 // visualize_best_fit
107 //
108 extern void
109 visualize_best_fit(const bfs::path & fn_prefix,
110  const image_t * a_img,
111  const image_t * b_img,
112  const base_transform_t * t_ab,
113  const std::vector<const match_t *> & ab,
114  const std::list<unsigned int> & inliers,
115  const mask_t * a_mask = NULL,
116  const mask_t * b_mask = NULL);
117 
118 //----------------------------------------------------------------
119 // visualize_matches_v2
120 //
121 // visualize the matching keys:
122 //
123 extern void
124 visualize_matches_v2(const pyramid_t & a,
125  const pyramid_t & b,
126  const std::list<const match_t *> & ab,
127  const bfs::path & fn_prefix,
128  unsigned int num_keys = ~0);
129 
130 //----------------------------------------------------------------
131 // visualize_nn
132 //
133 extern void
134 visualize_nn(const bfs::path & fn_prefix,
135  const pyramid_t & a,
136  const pyramid_t & b,
137  const ext_wrapper_t & b_key_wrapper,
138  const std::vector<ext_wrapper_t> & a_key_wrappers,
139  const double & window_radius);
140 
141 
142 //----------------------------------------------------------------
143 // dump
144 //
145 extern void
146 dump(std::ostream & so,
147  const double * data,
148  const unsigned int & size,
149  const unsigned int & height = 10,
150  const bool & normalize = false);
151 
152 
153 //----------------------------------------------------------------
154 // dump
155 //
156 extern void
157 dump(std::ostream & so,
158  const double * data_a,
159  const double * data_b,
160  const unsigned int & size,
161  const unsigned int & height = 10,
162  const bool & normalize = false);
163 
164 
165 #endif // VISUALIZE_HXX_
Definition: extrema.hxx:120
Definition: pyramid.hxx:173