# How to enable nifti2 library

**URL:** <https://discourse.itk.org/t/how-to-enable-nifti2-library/3397>\
**Category:** Engineering\
**Created:** [August 18, 2020, 3:25am UTC](https://discourse.itk.org/t/how-to-enable-nifti2-library/3397 "2020-08-18T03:25:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)\
**Post date:** [August 18, 2020, 3:25am UTC](https://discourse.itk.org/t/how-to-enable-nifti2-library/3397/1 "2020-08-18T03:25:23Z")

</div>

I would like to try using nifti2 library, but if I set USE\_NIFTI2\_CODE then it gets reverted to USE\_NIFTI2\_CODE=OFF in this line:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/NIFTI/src/CMakeLists.txt#L8>

Is this intentional?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 18, 2020, 1:36pm UTC](https://discourse.itk.org/t/how-to-enable-nifti2-library/3397/2 "2020-08-18T13:36:23Z")

</div>

It it probably intentional, but @hjmjohnson could provide more information as he last [updated it](https://github.com/InsightSoftwareConsortium/ITK/commit/0cdb1dd5b38bc9d5e8c4e43860cc9fa7774808e1).

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [August 18, 2020, 2:11pm UTC](https://discourse.itk.org/t/how-to-enable-nifti2-library/3397/3 "2020-08-18T14:11:46Z")

</div>

@lassoan. At the time of the last update of ITK’s nifti\_clib code, was unable to verify that the nifti2 support would work. I have seen recent work on on the upstream nfti\_clib package to fix some deficiencies with the behaviors of nifti2, and I am unsure if they have been resolved.

I would recommend 1) verifying that nifti2 is stable in the upstream nifti\_clib implementation, 2) updating ITK’s internal NIFTI with the latest upstream code, and then 3) doing your test.

This is a backburner item for me to do, but it will likely not be until next spring before I get a chance to work on it.

Hans

---

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)\
**Post date:** [August 18, 2020, 2:26pm UTC](https://discourse.itk.org/t/how-to-enable-nifti2-library/3397/4 "2020-08-18T14:26:24Z")

</div>

Thank you, I just wanted to make sure that I don’t miss something trivial. I’ve submitted an [issue](https://github.com/InsightSoftwareConsortium/ITK/issues/1958) for the problem that I’ve been experiencing with niftilib (and you have already commented on it - thank you).
