Skip to content

Commit edf092f

Browse files
committed
removed the pixel diff, was not really important and a distraction, if useful, could create another example, but given it deals with pixel images, is largely redundant
1 parent 746d328 commit edf092f

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

examples/Example_get_apr.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Advanced (Direct) Settings:
2525
-mask_file mask_file_tiff (takes an input image uint16_t, assumes all zero regions should be ignored by the APR, useful for pre-processing of isolating desired content, or using another channel as a mask)
2626
-rel_error rel_error_value (Reasonable ranges are from .08-.15), Default: 0.1
2727
-normalize_input (flag that will rescale the input from the input data range to 80% of the output data type range, useful for float scaled datasets)
28-
-store_delta (stores the delta between an APR reconstruction and the original image as an additional hdf5 file)
2928
-compress_level (the IO uses BLOSC for lossless compression of the APR, this can be set from 1-9, where higher increases the compression level. Note, this can come at a significant time increase.)
3029
)";
3130

@@ -119,48 +118,6 @@ int main(int argc, char **argv) {
119118
std::cout << "Lossy Compression Ratio: " << original_pixel_image_size/apr_file_size << std::endl;
120119
std::cout << std::endl;
121120

122-
if(options.store_delta){
123-
//feel free to change
124-
unsigned int blosc_comp_type = BLOSC_ZSTD;
125-
unsigned int blosc_comp_level = options.compress_level;
126-
unsigned int blosc_shuffle = 1;
127-
128-
PixelData<uint16_t> recon_image;
129-
130-
apr.interp_img(recon_image, apr.particles_intensities);
131-
132-
TiffUtils::TiffInfo inputTiff(options.directory + options.input);
133-
PixelData<uint16_t> inputImage = TiffUtils::getMesh<uint16_t>(inputTiff);
134-
135-
PixelData<int16_t> diff_image(inputImage.y_num,inputImage.x_num,inputImage.z_num,0);
136-
137-
#ifdef HAVE_OPENMP
138-
#pragma omp parallel for schedule(static)
139-
#endif
140-
for (int i = 0; i < inputImage.mesh.size(); ++i) {
141-
142-
diff_image.mesh[i] = 2 * abs(recon_image.mesh[i] - inputImage.mesh[i]) +
143-
((recon_image.mesh[i] - inputImage.mesh[i]) > 0);
144-
}
145-
146-
std::cout << "Storing diff image for lossless reconstruction" << std::endl;
147-
APRWriter aprWriter;
148-
float file_size = aprWriter.write_mesh_to_hdf5(diff_image,save_loc,file_name,blosc_comp_type,blosc_comp_level,blosc_shuffle);
149-
std::cout << "Size of the image diff: " << file_size << " MB" << std::endl;
150-
151-
std::cout << std::endl;
152-
std::cout << "Lossless Compression Ratio (APR + diff): " << original_pixel_image_size/(file_size + apr_file_size) << std::endl;
153-
std::cout << std::endl;
154-
155-
float file_size_org = aprWriter.write_mesh_to_hdf5(inputImage,save_loc,file_name,blosc_comp_type,blosc_comp_level,blosc_shuffle);
156-
std::cout << "Size of the pixel image compressed: " << file_size_org << " MB" << std::endl;
157-
158-
std::cout << std::endl;
159-
std::cout << "Lossless Compression Ratio (Pixel Image): " << original_pixel_image_size/(file_size_org) << std::endl;
160-
std::cout << std::endl;
161-
162-
}
163-
164121

165122
} else {
166123
std::cout << "Oops, something went wrong. APR not computed :(." << std::endl;

0 commit comments

Comments
 (0)