Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I encountered a bug when trying to use
brain2mesh
to build a mesh from the ICBM 2009c Nonlinear Asymmetric Atlas (available here). This issue occurs when reading NIfTI files containingint16
data.To reproduce the error you can use the following Docker image: aldoclemente/iso2mesh-bug.
Steps to reproduce the issue
Pull the Docker image and run the container:
Inside the container, you will find four directories:
~/octave/
: contains the required packages to runbrain2mesh
.~/mni_icbm152_nlin_asym_09c/
: contains the nifti data.~/jnii_uint16/
: contains the.jnii
data obtained using the older version ofnii2jnii
(created with~/mni_icbm152_nlin_asym_09c_jnii_uint16.m
).~/jnii/
: : contains the.jnii
data obtained using the newer version ofnii2jnii
(created with~/mni_icbm152_nlin_asym_09c_jnii.m
).You can run the script that reproduces the error:
To test the corrected version of
nii2jnii
, run:You can inspect the output matrices (nodes, elements, and faces) with:
Additional note
While running Octave in Docker, I encountered another minor issue at line 239 of
nii2jnii.m
.To ensure proper execution, I had to modify this line in both versions of
iso2mesh
:original:
modified:
I also observed this behaviour when using the gnuoctave/octave Docker image.
However, I did not observe this issue when running Octave on my local machine, so I did not include it in the pull request.
Let me know if you need any further details!
Kind regards,
Aldo