WIP: BUG: The Z spacing was set using thickness#112
WIP: BUG: The Z spacing was set using thickness#112hjmjohnson wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
Conversation
This addresses https://issues.itk.org/jira/browse/ITK-3527 According Dicom standard (DICOM PS3.6 2016b - Data Dictionary) (0028, 0030) indicates physical X,Y spacing inside a slice; (0018, 0088) indicates physical Z spacing between slices; which above are also consistent with Dcom2iix software. In current code, the zSpace is get from (0x0018,0x0050) which actually is the thickness from which the signal is created, not the separation of signal samplings. This patch set resolves the problem by updating the Z get spacing method by using (0018, 0088) when it is available. If (0018, 0088) is not available, then the code reverts to the previous behavior of using (0x0018,0x0050). Change-Id: I1111c55dd9e15444411e31bd6f2f1e68b7cf7618
|
http://review.source.kitware.com/#/c/22094/ Hans J. Johnson Hans J. Johnson Kitware Build Robot Francois Budin Hui Xie Kitware Build Robot Hui Xie Kitware Build Robot Matt McCormick Francois Budin Hui Xie Hui Xie Matt McCormick Hui Xie Hans J. Johnson Kitware Build Robot Matt McCormick Hans J. Johnson Hans J. Johnson Kitware Build Robot |
|
Accidently deleted/closed branch when the script for moving from Gerrit went haywire. |
malaterre
left a comment
There was a problem hiding this comment.
@dzenanz requested my review. I believe the code should be mostly fine on real world system, and is actually going in the right direction since using (0018,0050, Slice Thickness) is a major flaw. But since I am strong opponent of using the (0018, 0088, Spacing Between Slices) in code base, I will vote against this PR. At a minimum I would suggest removing legacy mechanism of using Slice Thickness, the proper behavior for recomputing the Reconstruction Interval is described at:
https://stackoverflow.com/questions/37730772/get-distance-between-slices-in-dicom/41848360#41848360
or else somewhere in the itk::GDCMImageIO codebase.
|
@malaterre Is there any chance that you would be willing to fix this PR? It could really use an expert in the area to get it right. We have been hacking as sub-par solutions for a long time. I'd like to stay focused on other ITK improvements. Thank you for your consideration. Otherwise it will likely linger for a while longer. |
|
@hjmjohnson As mentioned above, I find acceptable the solution where you simply remove the legacy code path with Slice Thickness. Eg: should instead be simply: That's an acceptable solution for now. |
|
I will edit the PR per your suggestion @malaterre |
|
see #243 |
Run the UpdateFromUpstream.sh script to extract upstream MINC
using the following shell commands.
$ git archive --prefix=upstream-minc/ 728d19e8 --
./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
./check_clock_gettime.c | tar x
$ git shortlog --perl-regexp --author='^((?!Kitware Robot).*)$' --no-merges --abbrev=8 --format='%h %s' 592dd487..728d19e8
Matt McCormick (1):
84a05bd5 Add stdio.h for debug printf calls
Sean McBride (1):
52f9f1f2 Fixed clang -Wreserved-id-macro warnings
Vladimir S. FONOV (6):
0415c2c2 Fixed error message
2260c403 Updated build script to match minc-toolkit-v2
00d846c8 Fixed undefined behaviour in variable initialization
ea8b6c31 Updated CMAKE minimal version requirement, addresses InsightSoftwareConsortium#112
b831a849 Updated printf format specifications to resolve warnings
689f3b4e Added checks to make sure we have fabsf, also added option to skip building C++ library when not needed
cfhammill (1):
7e59a1d1 miconvert_voxel_to_real: Ignore scaling for float volumes
Change-Id: Iea04fd265be02ca833dd1d8e5f9942d7a7ed7e60
This addresses https://issues.itk.org/jira/browse/ITK-3527
According Dicom standard (DICOM PS3.6 2016b - Data Dictionary)
(0028, 0030) indicates physical X,Y spacing inside a slice;
(0018, 0088) indicates physical Z spacing between slices;
which above are also consistent with Dcom2iix software.
In current code, the zSpace is get from (0x0018,0x0050) which
actually is the thickness from which the signal is created,
not the separation of signal samplings.
This patch set resolves the problem by updating the Z get
spacing method by using (0018, 0088) when it is available.
If (0018, 0088) is not available, then the code reverts to
the previous behavior of using (0x0018,0x0050).