KHKs ImageJ I/O Utilities


Karl-Heinz Kunzelmann

  • 02.09.12 major rewrite of the codebase and added new features, too.
  • 14.09.09 added information about the name[] field in the header (nameStringInHeader)
  • 22.03.08 old and now irrelevant_code_removed
  • 23.03.08 KHKs_Scanco_ISQ_FileReader : Downsampling by factor 2 in x, y and z direction by calculating the average of the pixels which are reduced to one new pixel including adjustment of fi.width, fi.height,fi.depth and fi.unit
  • 16.02.08 Bugfix for files larger than 2 GB revisited
  • 29.06.06 pixeldistance is taken from the orginal ISQ file header and used for metric scaling in ImageJ (
  • 02.08.06 Bugfix for files larger than 2 GB (adjustment of offset and longOffset so that Skip will be correct)

Contained in KHKs_microCT.jar


Copy KHKs_microCT.jar into the ImageJ > plugins directory and restart ImageJ.


You will find the import routines in ImageJ > File > Import

  • “KHKs Scanco microCT ISQ FileReader…”
  • “KHKs Shimadzu microCT FileReader”

In addition the plugin directory will contain:

  • Plugins>KHKs MicroCT Tools, “KHKs Scanco microCT ISQ HeaderReader…”
  • Plugins>KHKs MicroCT Tools, “KHKs Crop_ISQ”

Additional details:


This file is nothing else then copying the modules which are used by imagej to import raw data or files into this one single file.It helped me a lot to understand imagejand it made it easier to devolop this tool

The usage should be self-explanatory.

In short you select a ROI for the import by entering the upper left and the lower right coordinate of the rectangle.

In order to obtain these coordinates you can deside how many slices you want to import and with which slice you start the import.

Then you take paper and pencile and note the required coordinates for the second import attempt.

Note: this tool was writen because we have only limited memory on our Windows PCs. It was my very first Java program!

Meaning of the checkboxes:

“Scale for lin. attenuation coeff.(LAC):”the ISQ files are signed integer (short) raw data (see Scanco Website for more information).To get a meaningful value for the linear attenuation coefficient the short values have to be divided by 4096. This makes it necessary to use float (4byte) instead of 2byte images, which consumes more memory. It should be default to use the scaled images for any grey level evaluation, if the morphology is the only important criterion then scaling is unnecessary and saves memory.

“Downsample by factor 2 in x,y,z (method = average:)”for a view overview on a computer with limited RAM the stack can be downscaled by the factor of 2 in x and y and z direction. The downsampling is made by averaging 8 pixels into 1 new pixel

“Check = distances in metric units, uncheck = pixels” Option to decide whether to import the images with metric units as taken from the ISQ-file or alternatively keep the distances in pixels. The pixel variant is useful to determine the ROI, otherwise it is better to use the metric units.

“8-bit-import (overrules ‘Scale for LAC’)” To save even more RAM then with Short one can decide to use 8-Bit stacks only. The 8-Bit-Stack is a massive data reduction. The values are a simple division of the short values by 256. For better visability - auto-adjust brightness and contrast yourself. To get a quick idea of the LAC based on the 8-bit-data you can multiply by 256 and divide by 4096 yourself. But be aware you will lose precision this way due to rounding errors.

TODO: Select the ROI with the mouse


KHKs_Scanco_ISQ_HeaderReader opens a Scanco ISQ File and reads the header info

We use it to display the information saved as “patient name”. The variable patient name is used to describe all our projects.


ImageJ comes already with some useful routines to read the Shimadzu µCT files. However, the files will not contain the necessary information on the resolution and the voxel dimensions. To attach these information to an ImageJ file you will need the plugin “KHKs Shimadzu µCT HeaderfileReader”. This plugin will get a subset of information from the header files which are associated with the Shimadzu µCT datafiles. The data files have the extension *.tif, while the header files have the extension *.inf. Please take care to leave the *.inf files in the same directory as the data files.

To import the Shimadzu µCT files please use the Files > Import > Image Sequence and enter in the following window:

  • The number of images you would like to open
  • The starting image
  • and “tif” in the “File Name Contains” field.

After you click “OK” you will import the tif-files into ImageJ and you will get what is called an image stack. This stack displays the images, but it does not contain the scaling information which is necessary for the subsequent evaluation.

To import the scaling information you have to open Plugins > KHKs Shimadzu µCT HeaderfileReader

The action of this plugin is rather unspectacular. If you have the *.inf files in the same directory as the *.tif files, then you will see the following “success message”.

This file reads the header of the Shimadzu MicroCT / Univ. Tokyo. This special version of the file does not import the package LEDataStream, it just neads the file:

in the same directory as this file is stored.


This file is a conversion utility to downsize the ISQ files. It keeps the ISQ header and crops the area outside the user defined ROI.

I did not look at the code for a very long time.

KHKs Viff File Reader and Writer (ImageJ plugin)


Karl-Heinz Kunzelmann


31.10.2009 Cleaning of code from 2007 for online publication


Contained in KHKs_ViffReaderAndWriter.jar archive


Copy KHKs_ViffReaderAndWriter.jar into the ImageJ > plugins directory and restart ImageJ.


You will find the import routines in ImageJ > File > Import

  • “KHKs ViffReader (*.xv)”

In addition the plugin directory will contain:

  • Plugins>KHKs Match3d, “KHKs ViffWriter”

The Viff file format is a KHOROS file format. We (Wolfram Gloger, Albert Mehl, Karl-Heinz Kunzelmann) started to use it around 1990 when we developed the laser scanners for wear evaluation which I used in my habilitation. The same file format is still in use, because the software Match3D (Wolfram Gloger) is still the best solution for wear measurements.

Match3D is copy protected, however. Therefore I developed my own matching software over the years. It will be available as an ImageJ plugin, too, as soon as I will find the time to clean the code.