Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mincreshape doesn't handle minc files with double/float storage type correctly when image_range is not specified #59

Open
vfonov opened this issue Nov 25, 2016 · 0 comments

Comments

@vfonov
Copy link
Member

vfonov commented Nov 25, 2016

With nl_subject04_grid_0.mnc being the output of minctracc in nonlinear mode:

file: nl_subject04_grid_0.mnc
image: signed__ double -1.7976931348623157081e+308 to 1.7976931348623157081e+308
image dimensions: vector_dimension zspace yspace xspace
    dimension name         length         step        start
    --------------         ------         ----        -----
    vector_dimension            3      unknown      unknown
    zspace                    166            2         -163
    yspace                    166            2         -183
    xspace                    144            2         -143

> mincstats -min -max nl_subject04_grid_0.mnc 
*** mincstats - reported min (-11.2532) doesn't equal header (-1.79769e+308)
*** mincstats - reported max (8.93648) doesn't equal header (1.79769e+308)
Min:               -11.25319685
Max:               8.936475648

Running mincreshape, 1st case (doesn't work):

> mincstats -min -max nl_subject04_grid_0_short_1.mnc
*** mincstats - reported min (1.79769e+308) doesn't equal header (-1.79769e+308)
*** mincstats - reported max (-1.79769e+308) doesn't equal header (1.79769e+308)
Min:               1.797693135e+308
Max:               -1.797693135e+308

Running mincrshape, 2nd case: setting arbitrary limited image range (works):

> mincstats -min -max nl_subject04_grid_0_short_2.mnc
*** mincstats - reported min (-11.2535) doesn't equal header (-100)
*** mincstats - reported max (8.93721) doesn't equal header (100)
Min:               -11.25352865
Max:               8.937209125

Running mincreshape with -normalize (doesn't work) :

> mincstats -min -max nl_subject04_grid_0_short_3.mnc 
*** mincstats - reported min (1.79769e+308) doesn't equal header (-1.79769e+308)
*** mincstats - reported max (-1.79769e+308) doesn't equal header (1.79769e+308)
Min:               1.797693135e+308
Max:               -1.797693135e+308
vfonov added a commit to BIC-MNI/libminc that referenced this issue Nov 25, 2016
thewtex pushed a commit to thewtex/ITK that referenced this issue Apr 29, 2017
Run the UpdateFromUpstream.sh script to extract upstream MINC
using the following shell commands.

$ git archive --prefix=upstream-minc/ 3d79acf3 -- 
./ChangeLog
./volume_io
./libsrc
./libsrc/minc_compat.h
./libcommon/minc_config.h
./libcommon/minc_config.c
./libsrc/minc_format_convert.c
./libsrc/value_conversion.c
./libsrc/hdf_convenience.c
./libcommon/read_file_names.c
./libsrc/minc_simple.c
./libcommon/time_stamp.h
./libsrc/hdf_convenience.h
./libsrc/type_limits.h
./libcommon/read_file_names.h
./libsrc/minc_varlists.h
./libcommon/restructure.h
./libsrc/nd_loop.h
./libcommon/restructure.c
./libsrc/minc_simple.h
./libsrc/strdup.c
./libsrc/minc_useful.h
./libsrc/minc_convenience.c
./libsrc/minc_basic.h
./libsrc/minc_compat.c
./libcommon/time_stamp.c
./libsrc/voxel_loop.h
./libsrc/minc_routines.h
./libsrc/minc_private.h
./libsrc/netcdf_convenience.c
./libsrc/voxel_loop.c
./libsrc/dim_conversion.c
./libsrc/minc_format_convert.h
./libsrc/nd_loop.c
./libcommon/ParseArgv.h
./libcommon/minc_error.c
./libcommon/minc_error.h
./libsrc/minc_structures.h
./libsrc/minc.h
./libsrc/image_conversion.c
./libcommon/ParseArgv.c
./libcommon/minc_common_defs.h
./COPYING
./UseLIBMINC.cmake.in
./NEWS
./AUTHORS
./libsrc2/m2util.c
./libsrc2/minc2_defs.h
./libsrc2/minc2_api.h
./libcommon/minc2_error.h
./libsrc2/grpattr.c
./libsrc2/hyper.c
./libsrc2/minc_compat2.h
./libcommon/minc2_error.c
./libsrc2/record.c
./libsrc2/volume.c
./libsrc2/datatype.c
./libsrc2/volprops.c
./libsrc2/valid.c
./libsrc2/convert.c
./libsrc2/free.c
./libsrc2/dimension.c
./libsrc2/label.c
./libsrc2/minc2.h
./libsrc2/minc2_private.h
./libsrc2/slice.c
./libsrc2/minc2_structs.h
./CMakeLists.txt
./nifti
./LIBMINCConfig.cmake.in
./README.release
./INSTALL
./config.h.cmake
./README
 | tar x
$ git shortlog --perl-regexp --author='^((?!Kitware Robot).*)$' --no-merges --abbrev=8 --format='%h %s' 8632513e..3d79acf3

Chris Hammill (1):
      06f3e87b Unsatisfying solution to issue InsightSoftwareConsortium#71

Robert D. Vincent (34):
      5b483ac0 Fix problem discovered by Jerome Redoute - voxel_loop programs do not properly remove the loop dimension if it contains a 'xxxx-width' variable.
      59678daa Minor fixes for MINC2.0 API. Implement alignment, properly record dimorder for irregular dimension variables, quiet some errors.
      f0126d35 Hopefully useful version of minc_get_world_transform() and new function minc_transform_to_world().
      3775a0a9 Propagate read errors such that voxel_loop() now returns an integer exit code.
      2e33bca0 Propagate read errors through volume_io as well.
      5ac1aca8 Fix warning.
      3ca34259 Correctly place attributes intended for the image variable (e.g. 'complete').
      25792953 Avoid repetitive code while correcting placement of attributes within the HDF5 hierarchy.
      17aa090d Fix BIC-MNI/minc-tools#45 - add quotes around argv items that contain spaces.
      e7101d7a Make sure variable is initialized.
      d99dd016 Fix InsightSoftwareConsortium#74, don't assume hid_t === int since this is no longer true in HDF5 1.10.
      e7df7ce1 Minor fixes so that miclose() return value is correct.
      2f6b922f Fix issues with proper ranging of data in NIfTI files.
      6fbea42f Fix memory leaks to keep LeakSanitizer happy.
      eb7cf239 Add multidim array tests.
      1f4a4c5a Fix warnings.
      3f0c0389 Fix BIC-MNI/Display#63, Ignore MGZ/freesurfer offsets so that volumes align with their surfaces.
      00ac284f Fix warnings for unused variables (in an unused test).
      3b2df807 Major fix to NIfTI reading for images with non-standard transforms.
      f01e9be2 Fix problem if scl_slope is zero.
      063fce99 Correctly read NIfTI files with a fifth dimension.
      1e1b300d Attempt to improve speed of NIfTI loader.
      f3f881fe Fix bug in nifti reader.
      433acc15 Implement some additional special cases for volume interpolation.
      85733672 Basic reader for NRRD format.
      14cee37d Fix minor memory leak.
      baced81b Add libcommon to LIBMINC_INCLUDE_DIRS_CONFIG so that minctools will build.
      931df645 Fix InsightSoftwareConsortium#78, correct documentation for miget_dimension_sampling_flag().
      c3841475 Fix use-after-free error.
      3d5a2277 Fix range calculation for small NIfTI files.
      62a6a849 Fix InsightSoftwareConsortium#80, memory leaks in hyperslab reading.
      b2fdfff7 testing for leaks.
      4d68e862 Free memory at end of test.
      3daa90b4 Fix issue when copying a non-allocated volume.

Vladimir S. FONOV (38):
      2c9fe645 Removing allocation  debug code, it is superseded by address sanitizer or valgrind
      d3ab23b5 Added proper flag to MIcomplete when minc file is successfully closed
      39d86771 Replaced C++ comment to C comment
      6ef58fe9 Added option to work with integer labels (avoid inter-slice scaling)
      9c27bde6 Disabled writing of complete flag temporarely
      5df49651 WIP: adding labels to volumeio
      89a82cf9 WIP: modifying volume_io to work properly with labels
      466cdede WIP: adding possibility to debug minc2 volume io interface
      bbf80974 Added labels support in volume_io and a new environment configuration variable MINC_PREFER_V2_API to force volume_io to use MINC2 API directly, mostly for debugging purposes
      3764357a Finalizing MINC2 api choise support in volume_io
      0bd33a2e Fixed segfault that creeped in after the previous commit
      46261240 Tweaking voxel_loop
      745d75a9 Removed FindHDF5 and bumped cmake version requirements, addresses InsightSoftwareConsortium#71
      d641c4fd Updating HDF5 variables, fixing libnifti internal build dependencies
      b45312d9 Disabled allocation debugging in volume_io - superceded by valgrind and asan
      21125c4b Downgraded cmake requirements to satisfy travis-ci
      44b8d4b3 Fixed memory leak in minc_long_attr tests
      92ba4fa2 Fixing function forgotten in d99dd01632dbcb62870870557b333142b9117e9a , related to InsightSoftwareConsortium#74
      eb7eb487 Fixing memory leak, addresses InsightSoftwareConsortium#75
      70a27484 Added description of environment variables
      96793536 Added explicit test for rint, addresses InsightSoftwareConsortium#77
      f134ca9c Updated brew control sum for HDF5
      eecefd5d Refactoring minc2 internals
      34b08c7e Trying to make travis-build happy
      d9d98771 Fixed dimorder variable contents for image-min and image-max
      54169226 Made some tests actually perform something meaningless and report errors if things don't work
      dbf3e037 Minor change: fixed comments
      dd93215a Refactring error handling in volume_io
      f864dd22 Fixing failed build when MINC1 support is disabled
      bb7ce2db Refactoring common minc1&minc2 code
      a74eef51 Refactoring minc error reporting
      cba6f09b Bumped package patch version
      b1cd7f50 Updated comment for restructure
      d8cdab34 Hopefully fixes compilation issue on Windows, addresses CoBrALab/atlases#6
      bd17b1f2 Replaced c++ style comment with c
      a44cf8de Added a hack to address BIC-MNI/minc-tools#59
      f8f16142 Fixed volume_io error reporting routine, adresses BIC-MNI/Register#16
      3d79acf3 Fixing issue from Slicer/Slicer#716: moved code from libsrc into libcommon, removed unused varable

Change-Id: I8d3238e3bf830b6c4df9a64df35567e01268a030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant