To support CamBAfx UI work, we had developed an implementation of NifTI library in Java. You can find details of the library at http://genericfx.wordpress.com/2008/01/22/brainfxs-nifti-implementation/. The actual code is at this sourceforge.net site: http://sourceforge.net/projects/brainfx
It is available under General Public License version 3 or later, with the standard Classpath exception.
Highlights:
(1)set related items in one single function call, e.g. nim.setBasicMetaData(dim,pixdim,datatype, space_unit, time_unit) =>Less chance for forgetting to set related parameters.
(2)No need to fiddle with sizeof_hdr, bitpix, voxoffset, magic[]. You cannot even if you want to. NifTi1FileStream will take care of it for you automatically when you read/write from file
(3)Nifti1Infoset (equivalent to Nifti1Dataset in niftijlib), has a store where you can store anything as long as you can provide a unique key. In fact, this store is used to store the actual image data using NIFTI.COMPLETE_DATA_KEY, and nifti extension using the keys NIfti1Infoset.EXTENSION_ECODE_PREFIX+<ecode>
(4)It is developed as a framework. For example it has INiftiComparator and INiftiValidator interfaces to compare and validate NifTi files.