99#ifndef PARTPLAY_APR_CONVERTER_HPP
1010#define PARTPLAY_APR_CONVERTER_HPP
1111
12- #include " ../ data_structures/Mesh/MeshData .hpp"
12+ #include " data_structures/Mesh/PixelData .hpp"
1313#include " ../io/TiffUtils.hpp"
1414#include " ../data_structures/APR/APR.hpp"
1515
@@ -51,30 +51,30 @@ class APRConverter: public LocalIntensityScale, public ComputeGradient, public L
5151private:
5252 // get apr without setting parameters, and with an already loaded image.
5353 template <typename T>
54- bool get_apr_method (APR<ImageType> &aAPR, MeshData <T> &input_image);
54+ bool get_apr_method (APR<ImageType> &aAPR, PixelData <T> &input_image);
5555
5656 // pointer to the APR structure so member functions can have access if they need
5757 const APR<ImageType> *apr;
5858
5959 template <typename T>
60- void init_apr (APR<ImageType>& aAPR, MeshData <T>& input_image);
60+ void init_apr (APR<ImageType>& aAPR, PixelData <T>& input_image);
6161
6262 template <typename T>
63- void auto_parameters (const MeshData <T> &input_img);
63+ void auto_parameters (const PixelData <T> &input_img);
6464
6565 template <typename T>
6666 bool get_apr_method_from_file (APR<ImageType> &aAPR, const TiffUtils::TiffInfo &aTiffFile);
6767
68- void get_gradient (MeshData <ImageType> &image_temp, MeshData <ImageType> &grad_temp, MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2, float bspline_offset);
69- void get_local_intensity_scale (MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2);
70- void get_local_particle_cell_set (MeshData <ImageType> &grad_temp, MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2);
68+ void get_gradient (PixelData <ImageType> &image_temp, PixelData <ImageType> &grad_temp, PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2, float bspline_offset);
69+ void get_local_intensity_scale (PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2);
70+ void get_local_particle_cell_set (PixelData <ImageType> &grad_temp, PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2);
7171};
7272
7373template <typename T>
7474struct MinMax {T min; T max; };
7575
7676template <typename T>
77- MinMax<T> getMinMax (const MeshData <T>& input_image) {
77+ MinMax<T> getMinMax (const PixelData <T>& input_image) {
7878 T minVal = std::numeric_limits<T>::max ();
7979 T maxVal = std::numeric_limits<T>::min ();
8080
@@ -96,7 +96,7 @@ MinMax<T> getMinMax(const MeshData<T>& input_image) {
9696template <typename ImageType> template <typename T>
9797bool APRConverter<ImageType>::get_apr_method_from_file(APR<ImageType> &aAPR, const TiffUtils::TiffInfo &aTiffFile) {
9898 allocation_timer.start_timer (" read tif input image" );
99- MeshData <T> inputImage = TiffUtils::getMesh<T>(aTiffFile);
99+ PixelData <T> inputImage = TiffUtils::getMesh<T>(aTiffFile);
100100 allocation_timer.stop_timer ();
101101
102102 method_timer.start_timer (" calculate automatic parameters" );
@@ -141,7 +141,7 @@ bool APRConverter<ImageType>::get_apr_method_from_file(APR<ImageType> &aAPR, con
141141 * Main method for constructing the APR from an input image
142142 */
143143template <typename ImageType> template <typename T>
144- bool APRConverter<ImageType>::get_apr_method(APR<ImageType> &aAPR, MeshData <T>& input_image) {
144+ bool APRConverter<ImageType>::get_apr_method(APR<ImageType> &aAPR, PixelData <T>& input_image) {
145145 apr = &aAPR; // in case it was called directly
146146
147147 total_timer.start_timer (" Total_pipeline_excluding_IO" );
@@ -155,12 +155,12 @@ bool APRConverter<ImageType>::get_apr_method(APR<ImageType> &aAPR, MeshData<T>&
155155 // assuming uint16, the total memory cost shoudl be approximately (1 + 1 + 1/8 + 2/8 + 2/8) = 2 5/8 original image size in u16bit
156156 // storage of the particle cell tree for computing the pulling scheme
157157 allocation_timer.start_timer (" init and copy image" );
158- MeshData <ImageType> image_temp (input_image, false /* don't copy */ ); // global image variable useful for passing between methods, or re-using memory (should be the only full sized copy of the image)
159- MeshData <ImageType> grad_temp; // should be a down-sampled image
158+ PixelData <ImageType> image_temp (input_image, false /* don't copy */ ); // global image variable useful for passing between methods, or re-using memory (should be the only full sized copy of the image)
159+ PixelData <ImageType> grad_temp; // should be a down-sampled image
160160 grad_temp.initDownsampled (input_image.y_num , input_image.x_num , input_image.z_num , 0 );
161- MeshData <float > local_scale_temp; // Used as down-sampled images for some averaging steps where it is useful to not lose precision, or get over-flow errors
161+ PixelData <float > local_scale_temp; // Used as down-sampled images for some averaging steps where it is useful to not lose precision, or get over-flow errors
162162 local_scale_temp.initDownsampled (input_image.y_num , input_image.x_num , input_image.z_num );
163- MeshData <float > local_scale_temp2;
163+ PixelData <float > local_scale_temp2;
164164 local_scale_temp2.initDownsampled (input_image.y_num , input_image.x_num , input_image.z_num );
165165 allocation_timer.stop_timer ();
166166
@@ -206,7 +206,7 @@ bool APRConverter<ImageType>::get_apr_method(APR<ImageType> &aAPR, MeshData<T>&
206206 method_timer.stop_timer ();
207207
208208 method_timer.start_timer (" downsample_pyramid" );
209- std::vector<MeshData <T>> downsampled_img;
209+ std::vector<PixelData <T>> downsampled_img;
210210 // Down-sample the image for particle intensity estimation
211211 downsamplePyrmaid (input_image, downsampled_img, aAPR.level_max (), aAPR.level_min ());
212212 method_timer.stop_timer ();
@@ -229,7 +229,7 @@ bool APRConverter<ImageType>::get_apr_method(APR<ImageType> &aAPR, MeshData<T>&
229229}
230230
231231template <typename ImageType>
232- void APRConverter<ImageType>::get_local_particle_cell_set(MeshData <ImageType> &grad_temp, MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2) {
232+ void APRConverter<ImageType>::get_local_particle_cell_set(PixelData <ImageType> &grad_temp, PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2) {
233233 //
234234 // Computes the Local Particle Cell Set from a down-sampled local intensity scale (\sigma) and gradient magnitude
235235 //
@@ -274,7 +274,7 @@ void APRConverter<ImageType>::get_local_particle_cell_set(MeshData<ImageType> &g
274274}
275275
276276template <typename ImageType>
277- void APRConverter<ImageType>::get_gradient(MeshData <ImageType> &image_temp, MeshData <ImageType> &grad_temp, MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2, float bspline_offset) {
277+ void APRConverter<ImageType>::get_gradient(PixelData <ImageType> &image_temp, PixelData <ImageType> &grad_temp, PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2, float bspline_offset) {
278278 // Bevan Cheeseman 2018
279279 // Calculate the gradient from the input image. (You could replace this method with your own)
280280 // Input: full sized image.
@@ -335,7 +335,7 @@ void APRConverter<ImageType>::get_gradient(MeshData<ImageType> &image_temp, Mesh
335335}
336336
337337template <typename ImageType>
338- void APRConverter<ImageType>::get_local_intensity_scale(MeshData <float > &local_scale_temp, MeshData <float > &local_scale_temp2) {
338+ void APRConverter<ImageType>::get_local_intensity_scale(PixelData <float > &local_scale_temp, PixelData <float > &local_scale_temp2) {
339339 //
340340 // Calculate the Local Intensity Scale (You could replace this method with your own)
341341 //
@@ -385,7 +385,7 @@ void APRConverter<ImageType>::get_local_intensity_scale(MeshData<float> &local_s
385385
386386
387387template <typename ImageType> template <typename T>
388- void APRConverter<ImageType>::init_apr(APR<ImageType>& aAPR,MeshData <T>& input_image){
388+ void APRConverter<ImageType>::init_apr(APR<ImageType>& aAPR,PixelData <T>& input_image){
389389 //
390390 // Initializing the size of the APR, min and maximum level (in the data structures it is called depth)
391391 //
@@ -406,7 +406,7 @@ void APRConverter<ImageType>::init_apr(APR<ImageType>& aAPR,MeshData<T>& input_i
406406}
407407
408408template <typename ImageType> template <typename T>
409- void APRConverter<ImageType>::auto_parameters(const MeshData <T>& input_img){
409+ void APRConverter<ImageType>::auto_parameters(const PixelData <T>& input_img){
410410 //
411411 // Simple automatic parameter selection for 3D APR Flouresence Images
412412 //
@@ -484,7 +484,7 @@ void APRConverter<ImageType>::auto_parameters(const MeshData<T>& input_img){
484484 float proportion_flat = freq[0 ]/(counter*1 .0f );
485485 float proportion_next = freq[1 ]/(counter*1 .0f );
486486
487- MeshData <T> histogram;
487+ PixelData <T> histogram;
488488 histogram.init (num_bins, 1 , 1 );
489489 std::copy (freq.begin (),freq.end (),histogram.mesh .begin ());
490490
0 commit comments