Skip to content

Commit 4ab6d4c

Browse files
committed
minor changes
1 parent 1b87277 commit 4ab6d4c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

examples/Example_get_apr.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ Advanced (Direct) Settings:
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)
2828
-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.)
29+
-compress_type (Default: 0, loss-less compression of partilce intensities, (1,2) WNL (Balázs et al. 2017) - approach compression applied to particles (1 = without prediction, 2 = with)
30+
2931
-neighborhood_optimization_off turns off the neighborhood opetimization (This results in boundary Particle Cells also being increased in resolution after the Pulling Scheme step)
3032
-output_steps Writes tiff images of the individual steps (gradient magnitude, local intensity scale, and final level of the APR calculation).
33+
3134
)";
3235

3336
#include <algorithm>
@@ -94,6 +97,8 @@ int main(int argc, char **argv) {
9497
unsigned int blosc_comp_level = options.compress_level;
9598
unsigned int blosc_shuffle = 1;
9699

100+
apr.apr_compress.set_compression_type(options.compress_type);
101+
97102
//write the APR to hdf5 file
98103
FileSizeInfo fileSizeInfo = apr.write_apr(save_loc,file_name,blosc_comp_type,blosc_comp_level,blosc_shuffle);
99104
float apr_file_size = fileSizeInfo.total_file_size;
@@ -122,7 +127,6 @@ int main(int argc, char **argv) {
122127
TiffUtils::saveMeshAsTiff(output_path, level);
123128
}
124129

125-
126130
} else {
127131
std::cout << "Oops, something went wrong. APR not computed :(." << std::endl;
128132
}
@@ -225,6 +229,11 @@ cmdLineOptions read_command_line_options(int argc, char **argv){
225229
result.compress_level = (unsigned int)std::stoi(std::string(get_command_option(argv, argv + argc, "-compress_level")));
226230
}
227231

232+
if(command_option_exists(argv, argv + argc, "-compress_type"))
233+
{
234+
result.compress_type = (unsigned int)std::stoi(std::string(get_command_option(argv, argv + argc, "-compress_type")));
235+
}
236+
228237
if(command_option_exists(argv, argv + argc, "-normalize_input"))
229238
{
230239
result.normalize_input = true;

examples/Example_get_apr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct cmdLineOptions{
2222
bool neighborhood_optimization = true;
2323
bool output_steps = false;
2424
unsigned int compress_level = 2;
25+
unsigned int compress_type = 0;
2526

2627
float Ip_th = -1;
2728
float SNR_min = -1;

src/data_structures/APR/APR.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class APR {
2727
APRWriter apr_writer;
2828
APRReconstruction apr_recon;
2929

30-
3130
public:
3231

3332
APRAccess apr_access;
3433
APRConverter<ImageType> apr_converter;
34+
APRCompress<ImageType> apr_compress;
3535

3636
ExtraParticleData<ImageType> particles_intensities;
3737
std::string name;
@@ -86,9 +86,8 @@ class APR {
8686
}
8787

8888
FileSizeInfo write_apr(std::string save_loc,std::string file_name,unsigned int blosc_comp_type,unsigned int blosc_comp_level,unsigned int blosc_shuffle){
89-
APRCompress<ImageType> apr_compressor;
90-
apr_compressor.set_compression_type(0);
91-
return apr_writer.write_apr((*this),save_loc, file_name, apr_compressor,blosc_comp_type ,blosc_comp_level,blosc_shuffle);
89+
90+
return apr_writer.write_apr((*this),save_loc, file_name, this->apr_compress,blosc_comp_type ,blosc_comp_level,blosc_shuffle);
9291
}
9392

9493
//generate APR that can be read by paraview

0 commit comments

Comments
 (0)