From 5e7e8a1df73b97630d0b710069dacbcfdf3e34ad Mon Sep 17 00:00:00 2001 From: Andrew Jewett Date: Sun, 6 Mar 2022 22:45:10 -0800 Subject: [PATCH] now the voxel width in the output tomogram equals the number passed to the "-w" argument --- bin/filter_mrc/filter_mrc.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/filter_mrc/filter_mrc.cpp b/bin/filter_mrc/filter_mrc.cpp index 76f0726..88ed455 100644 --- a/bin/filter_mrc/filter_mrc.cpp +++ b/bin/filter_mrc/filter_mrc.cpp @@ -29,8 +29,8 @@ using namespace std; string g_program_name("filter_mrc"); -string g_version_string("0.29.20"); -string g_date_string("2021-11-28"); +string g_version_string("0.29.21"); +string g_date_string("2022-3-06"); @@ -407,6 +407,17 @@ int main(int argc, char **argv) { throw VisfdErr("Error in tomogram header: Invalid voxel width(s).\n" "Use the -w argument to specify the voxel width."); + // If the user customized the voxel width (using the "-w" argument, + // for example), then include this information in the header portion + // of the output tomogram. + if (voxel_width[0] != tomo_in.header.cellA[0]/image_size[0]) + tomo_out.header.cellA[0] = image_size[0] * voxel_width[0]; + if (voxel_width[1] != tomo_in.header.cellA[1]/image_size[1]) + tomo_out.header.cellA[1] = image_size[1] * voxel_width[1]; + if (voxel_width[2] != tomo_in.header.cellA[2]/image_size[2]) + tomo_out.header.cellA[2] = image_size[2] * voxel_width[2]; + + // ---- Select the primary operation we will perform on the image ----