# Contents

0. Preface
1. Installation
2. Image formats
3. Using the mouse
4. Main OSIRIS window
5. Image display in windows
6. Menus

6.1 Main menu
6.2 File menu
6.3 Edit menu
6.4 Display menu
6.5 Overlays menu
6.6 Tools menu
6.7 Processing menu

7. Clinical tools

7.1 Multiplanar sections
7.2 Ejection fraction
7.3 Segmentation

8. Color manipulation
9. Overlays
Appendix 1 : File organization
Appendix 2 : Data Import/Export (File Formats)
Appendix 3 : Color lookup tables
Appendix 4 : Intensity settings
Appendix 5 : Convolution filters
Appendix 6 : Relative versus absolute color mode
Appendix 7 : Log file

# Preface

This document describes how to use the OSIRIS imaging software.

OSIRIS is a portable and expandable software for interactive manipulation of digital medical images. The OSIRIS software, developed at the University Hospital of Geneva, has been implemented on different hardware platforms. Three major operating systems are referred to in this document:

- Unix-based workstations with X11-window system enhanced by OSF-Motif widgets,

- Apple Macintosh workstations (68k and PowerPC based),

- PC running Microsoft Windows.

We welcome your comments concerning errors and suggestions for modifications you would like to see made. Please send them to the address below.

Osiris & Papyrus Team

Mr. Christian GIRARD (girard@dim.hcuge.ch)
Dr. Yves LIGIER (ligier@dim.hcuge.ch)
Mrs. Marianne LOGEAN (logean@dim.hcuge.ch)
Dr. Osman RATIB (ratib@dim.hcuge.ch)
Mr. Ronald WELZ (100343.3106@compuserve.com)

Digital Imaging Unit
University Hospital of Geneva
24, rue Micheli du Crest
1211 Geneva 14, Switzerland

Fax: + 41 22 37 26 198
e-mail: osiris@dim.hcuge.ch

# 1. Installation

The installation of the OSIRIS software is specific to each type of workstation:

## Macintosh

Copy the OSIRIS software as well as the OsirisPrefs folder onto your hard disk. These two items must be in the same directory. Double click on the OSIRIS icon to start the application. System 7 or higher is required. Set your monitor to 256 colors (Monitors command in the Control Panels). It is recommended to have at least 8 MBytes of RAM.

## Unix/X/Motif

Copy the contents of the distribution tape into a directory (example: /usr/local).

All the files are contained in a tar file.
Example:

    > cd /usr/local; tar xvf /dev/rst0

It will automatically create the directory /usr/local/Osiris

Then, set the following environment variables:

Set DIRIMAGES to locate the directory where the PAPYRUS images are stored.

    > setenv DIRIMAGES /usr/local/Osiris/Images

Set OSIRIS_CLUTS_DIR to locate the directory where the color lookup tables and the intensity settings are stored.

    >setenv OSIRIS_CLUTS_DIR /usr/local/Osiris/OsirisPrefs/ColorDir

Set PREFERENCES to locate the directory where the preference file is stored.

    > setenv PREFERENCES /usr/local/Osiris/OsirisPrefs

Put the resource file osiris into the following directory:

    /usr/lib/X11/app-defaults

Select the executable version (Sun, HP, IBM, Dec, ...) and rename it osiris (name must be the same as the resource file).

Finally, launch the OSIRIS program with the command osiris.

Remark : if you are using a window manager other than mwm (motif window manager), you may encounter some problems with the window manipulations such as window resizing. The use of mwm is therefore recommended.

Remark : on Solaris 2.4, Osiris is a dynamic executable which needs some libraries. So, set the following variable

    setenv LD-LIBRARY-PATH   /usr/dt/lib

## PC/MS Windows

To install Osiris on your hard-disk, run the setup.exe program included on the distribution media (CD-ROM or floppy disk). It is recommended to have 16 MBytes of RAM, a 486 processor, and a multicolor display driver (256 colors are required). The setup program does not install sample images.

Appendix 1 gives more information about the file hierarchy used to install OSIRIS.

# 2. Image formats

OSIRIS, on all platforms, reads and writes images stored in the PAPYRUS file format (version 2 and version 3). This ACR/NEMA - DICOM based file format has been designed at the University Hospital of Geneva. Its specifications are in the public domain. It has been adopted by European research projects as well as by other institutions (hospitals, manufacturers) as a medical image file format. It is also used for the communication of medical images. All platforms are also able to read raw data files (see Appendix 2 for more information) and files containing a single DICOM image.

Remark: the Macintosh version has also the ability to read other file formats (see Appendix 2), while the PC/Windows version can read TIFF images.

# 3. Using the mouse

Direct manipulation allows you to control the application by choosing selections from a menu and by setting controls following a point-and-click method. In the point-and-click method, you move the mouse until the mouse pointer is over (points to) the desired object.

Clicking - Quickly pressing and releasing a mouse button without moving the mouse.
Double-Clicking - Clicking a mouse button twice in rapid succession without moving the mouse pointer.
Dragging - Moving the mouse while the mouse button is being pressed.

There is, however, a major difference between the Macintosh, the X/Motif and the PC/Windows mouses. The Macintosh mouse has only one button whereas the X-window interfaces assume a three-button mouse and the PC/Windows assume a two or three button mouse.

In order to have the OSIRIS software applicable to different environments, it is necessary to compromise between the different systems. The main principle is to use the left button whenever possible. The right button corresponds to option-click on the Mac. Both button options can be used in combination with the shift key. In the rest of this manual, the right button is equivalent to option-button.

With the keyboard, command key + alphanumeric key is often used as a shortcut to a menu command (Macintosh version).

# 4. Main OSIRIS window

An OSIRIS session allows the user to open several image files simultaneously. Each file contains a medical study defined by a set of one or more images displayed in a main window. Secondary windows are used to display other information such as patient demographic information, image reports, overlay data, etc. The basic window manipulations are consistent with each windowing environment : close box, maximize/minimize window box, resize and scroll bars. As a prerequesite, we assume the user is familiar with standard graphic user interface and windowing system. A set of image manipulation functions are always available through buttons on the left side of each main window:

All the functionalities defined by these buttons can also be accessed by menu commands. When clicking on the tools button a tools palette appears allowing to choose among another set of tools. These tools are explained in the Tools menu chapter (6.6).

Remark : the colors inversion button is different from the Invert command of the Display Menu. The button only inverts temporarily the color table as long as you press the mouse button. The invert menu command inverts the real image data permanently.

# 5. Image display in windows

As medical images often come in sets (sequential images of the same slice or sets of different views or sections) it was necessary to provide a way of handling more than one image at a time. The OSIRIS software supports two modes of presentation of a set of images :

- Tile mode (images side by side in a grid)

- Stack mode (images stacked one on top of the other)

One can switch from one mode to the other at anytime by clicking on the stack/tile button. The stack mode has two sub-modes: static and dynamic.

## Tile mode

In the tile mode, images of a set are displayed side by side in a grid that is optimized to be as square as possible based on the number and the size of the images to be displayed. If the number of images to be displayed cannot fill a grid, empty cells will be blacked out to provide a rectangular grid. The window scroll controls allow one to move across the set of images. The whole set behaves as a single large image. Therefore zooming or reducing the images will automatically change the magnification factor of the whole layout. The layout can be modified with the Tile Mode Layout command of the Display menu.

Example of a window containing a set of images in tile mode

The current image is surrounded by a green frame (light gray on the above picture). To select another current image, just click on it. It will become the current displayed image if you switch to the stack mode.

## Stack mode

In the stack mode, images are placed on top of each other to form a stack. You can browse through the stack by using the image selection buttons (left and right arrow buttons). A special indicator field in the window controls displays the sequential number of the image being displayed at a given time. Basic image manipulation commands executed in this mode are applied to the whole set of images in the stack.

## Dynamic display

In the stack mode you can also dynamically display the images in sequence. A special button (containing a camera) allows you to switch to a movie mode where all the images of a stack are displayed sequentially in time. The arrows used for browsing through the images will be replaced in this mode by a cursor for adjusting the speed of dynamic display. The button used for starting the movie mode indicates the current movie mode (loop forward, loop backward or rocking mode), clicking on it switches between the modes. To stop the movie mode, click on the displayed image (the cursor appears as a stop signal).

Three modes of dynamic display are provided:

- a continuous forward loop through the images,

- a continuous backward loop through the images,

- a rocking mode moving back and forth through the images.

Example of a window containing a set of images in stack mode

## Active images

When opening a set of images, all images are active. It is possible to deactivate them. In stack mode and movie mode, only active images are shown. In tile mode, deactivated images have a red cross over them.

To activate/deactivate an image, choose the tile mode and (with the neutral tool) option-click (or right button) on the images you want.

In tile mode, the Tile Mode Layout command of the Display menu also allows to activate/deactivate images.

## Image sorter

The original order in which images are displayed in OSIRIS is determined by the sequential order of the images in the file. However, this can be changed. To do so, choose the tile mode and the neutral tool (default tool). Then, hold down the shift and option keys (shift and right button) and drag an image to its new location. The image being moved is specified by a blue frame and the new location is indicated by a blue vertical line.

# 6. Menus

## 6.1 Main menu

The main menu appears on the upper left side of the screen on the Macintosh and on each main Osiris window on others workstations, but the functionalities remain the same on all systems.

Six menus are available in the OSIRIS software. The first two menus provide general functions common to most applications. The four others are used to separate the manipulation and processing functions in four categories: display manipulation, overlay manipulation, basic tools and image processing tools.

Remark: most of the actions performed by the user can be automatically recorded in a log file (see Appendix 7 for more information).

## 6.2 File menu

The File menu presents actions that deal with files. The commands in the File menu are divided into five groups:

Open a medical study (a set of images).
Close and save a medical study.
Output actions that send the file to an output device (printer for example).
Windows layout management (only for windows containing images) (Macintosh specific).
Quit the program.

- Open Images... - opens an existing file. The Open operation prompts you for the name of the file by displaying a dialog box for the purpose. The title bar of the newly opened window is created with the name of the opened file.

- Close - closes an existing window. All the secondary windows attached to this medical study are automatically closed.

- Save PAPYRUS 2 - saves the active images in a new PAPYRUS 2 file.

- Save PAPYRUS 3 - saves the active images in a new PAPYRUS 3 file.

- Save As... - saves the currently opened study under a new name. This operation prompts you for the name of the file to be saved by displaying a dialog box for the purpose. Only active images are saved. Overlays (annotations and ROI's) are saved in this new file. See dialog below.

- Export PICT - export images in a PICT file (refer to Appendix 2 for more details).

- Study Report - access to the text report of an image study. The text report must be stored in a file having the same filename except the extension which must be .doc. If the image file is dupont.pap, the software looks for a dupont.doc file. If it exists, then it is automatically opened by the application with which it has been created (text editor). If the report file is not found, it is created. OSIRIS does not provide any text editor application, it collaborates with existing applications.

- Page Setup... - formats the information for printing (Macintosh specific).

- Print - prints an image or the contents of a window (Macintosh specific).

- Clean Up Windows - arranges the layout of multiple windows (containing images) on the screen (Macintosh specific).

- Windows - shows the list of windows (containing images from a medical study), and allows the selection of one in order to bring it in front of other windows that may be obscuring it. Windows containing data (for example from a region of interest) are not affected by this function (Macintosh specific).

- Quit - ends the current application and closes all windows associated with it. In X/Motif, this action is equivalent to closing the last opened window of the application.

Open dialog with information about the study (image number, patient information, ...)

Image selection dialog (allows to select a subrange of images)

Save As... dialog

## 6.3 Edit menu

The Edit menu contains actions that modify the currently displayed data.

Undo actions that reverse the effect of previous actions.
Copy-Paste of overlays.
Cropping and extracting parts of images.
Other actions that allow you to modify the program setup and preferences.

- Undo - undo the most recent action concerning ROI modifications, image processing, etc.

- Cut - copies the selected overlays into the clipboard and deletes them from the image.

- Copy - copies the selected overlays of the current image (puts them into an internal clipboard). On the Mac, if no overlay is selected, it copies the content of the window (current image in stack mode and all images in tile mode, refer to Appendix 2 for further information).

- Paste - pastes the contents of the clipboard (a list of overlays) into the current image.

- Paste Special - this command allows to propagate a paste of overlays to all active images of a set.

- Crop - displays a portion of the images (the selection of the region to be displayed is done by using the selector tool). This operation applies to all images in the window (either in stack or tile mode).

- UnCrop - redisplays the images in their full size.

- Preferences... - allows modification of the program setup and the default parameters. A special dialog window is provided leading to different options and parameters to be modified. The preferences are saved in order to retrieve the same setup every time the program is launched.

Preferences dialog

The preferences dialog allows to :
- select the initial mode when opening a set of images (stack or tile),
- define the (default) position of the color panel,
- choose the position of an annotation relatively to the associated ROI (if any),
- show or hide the patient name when saving a file (useful to create anonymous files),
- activate or deactivate the log file facility (refer to Appendix 7 for further details).

## 6.4 Display menu

The Display menu contains actions that deal with secondary windows and general purpose image manipulation tools.

- Adjust Colors - calls the color adjustment dialog window to modify the contrast and intensity of the image(s) contained in the current window. See chapter 8 for further information.

- Color Adjust. Mode - allows the choice between relative and absolute color adjustment modes. See Appendix 6 for more information.

- Color Mask - interactive system allowing to assign a specific color to a range of pixel values. It is a kind of interactive segmentation tool. Refer to chapter 8 for more information about this tool.

- Tile Mode Layout - dialog window allowing the activation/deactivation of images in a set. It allows also to customize the layout of the tile mode (by specifying the number of rows or the number of columns). Only active in tile mode.

- Show Coordinates - opens a secondary window showing in real time the cursor position as well as the corresponding pixel value.

- Show Info - shows information specific to the medical study (patient demographic information, study acquisition parameters) or to the current image. The information is displayed in a secondary window.

- Invert Colors - inverts the real image data whereas the Invert button just inverts the colors as long as you press the mouse button.

- Zoom - Enlargement or reduction of an image within a window. In tile mode, the whole grid of images is enlarged as if it was a single image. In stack mode the magnification factor set on one image automatically applies to all images.

- Rotate - image rotation can be performed in 90 steps. A sub-menu allows the selection of clockwise or counterclockwise rotation. For a non-square image the window will be readjusted according to the new vertical and horizontal sizes.

- Flip - image flipping. A sub-menu provides the choice of horizontal and vertical flipping.

## 6.5 Overlays menu

OSIRIS allows the display of overlays onto images. Two types of overlays are possible : annotations and graphical regions of interest (ROI). The Overlays menu allows the manipulation of the overlays (showing or hiding them, changing their settings, or showing some associated data) but not their creation or their deletion (see the Tools menu). Chapter 9 gives more information about overlays.

- Show Overlays shows the overlays of all the images of a set. It is possible to show them all or partially, according to their color.

- Hide Overlays hides the overlays of all the images of a set. It is possible to hide them all or partially, according to their color.

- Clear Overlays deletes all overlays of all images of a set.

- Bring to Front brings the selected overlay to the top of the stack of overlays. Useful for changing the order of overlays.

- Send to Back sends the selected overlay to the bottom of the stack of overlays. Useful for selecting an overlay physically included in another overlay.

- Settings displays a dialog window to change the settings of overlays (colors of text and graphics, pen size, text size, text font, graphic shadow, contour smoothing). If one or more overlays are selected, changes will be applied to all selected overlays. If none are selected, changes will be applied to the default settings.

- Labels allows a defined label to be assigned to an annotation. Select the annotation or the attached ROI, and choose among the proposed labels of this menu command. The labels are stored in the file PrefOverlayLabels (located in the OsirisPrefs folder) which can be easily modified by the users. Syntax is the following :

      		label			: annotation label = label
      		label [short_label]	: annotation label = short_label
      					: separation line in the menu

  The first command allows to edit the content of an annotation (equivalent to option click).

- Show Data opens a secondary window showing statistics related to the selected ROI's (Region Of Interest). For a closed ROI, the minimum and maximum pixel values and the area are shown as well as the histogram of this region. For an ROI created with the profiler tool, the intensity profile of the line is shown.

- Multiple Roi Data extracts quantitative data of a given ROI over a set of active images. The data measured inside the ROI is calculated in each image of the set where this ROI (with the same label) is present. The results are displayed as minimum, maximum and average intensities, and area curves.

- Multiple Roi Volume computes the volume of a given ROI over a set of active images. Results are displayed in a separate window, including interactive 3D representation of the ROI over the set of images.

## 6.6 Tools menu

The Tools menu allows the creation of overlay objects, and the access to some basic tools such as the magnifying glass, the mover, the calliper, etc. The same tools can be accessed by both the Tools menu and the tools palette by clicking on the tools button in each OSIRIS main window. Some tools are also accessible by a shortcut (command key + alphanumeric key) on the Macintosh version.

Remark: Tools selection is persistent. Double click to return to neutral tool.

- Neutral Tool - this tool is used to select overlays. Clicking on an overlay selects it. To select several overlays use the combination shift + mouse click. A double click anywhere in the image allows one to select all the overlays of an image. You can also press and drag the mouse to define a rectangle. When you release the mouse button all the overlays included in the rectangle will be selected. If any other tool is active a double click switches back to the neutral mode.
  In tile mode, this tool allows to activate/deactivate images by pressing the option key (right button), and to change the order of images by pressing the shift -option key.

- Selector - Selection of a region of the current image. This selection can be used for cropping or for applying a filter to the selected region. The shift key propagates this region on all active images of the set. The option key restricts the region to a square. Both modifier keys can be used simultaneously.

- Rect. ROI - allows the creation of a rectangular ROI. Just press and drag the mouse to define the rectangle. The option key allows the rectangle to be restricted to a square.

- Ellip. ROI - allows the creation of an elliptic ROI. Just press and drag the mouse to define the ellipse. The option key allows the ellipse to be restricted to a circle.

- Polyg. ROI - allows the creation of a polygon. Click the mouse button to define the first point, move the mouse to the next point and click to define it. Each click on the mouse button defines a new point of the polygon. To end the polygon, double click. If the last point is located around the first point (in the region delimited by a circle) then the polygon will be automatically closed (the last point will be modified to equal the first point). A polygon can be edited point by point (click on the point that must be moved), a point can be deleted (just option click on it) and it is possible to create a new point by option clicking on a line segment.

- Pencil - allows the creation of a polygon by freehand drawing an irregular contour. Just click and drag the mouse to trace a curve. To end, release the mouse button. If this is done close enough to the first point, the curve (a polygon) will be closed automatically.

- Calliper - allows measurements to be made along a line. The length is displayed as an annotation associated with the line. The postit will give you more information (start and end points, angle with the horizontal line). If the PAPYRUS file contains a calibration factor the distance units will automatically be mm. If this factor does not exist, then pixel units are used. Holding down the option key allows the image to be manually calibrated. Holding down the shift key restricts the calliper to a horizontal or vertical line.

- Angle - defines three points (p0, p1, p2) to create an angle (by clicking the mouse) and one obtains the angle formed by the lines (p0, p1) and (p0, p2). Note that the first point determines the center point. When moving the angle, pressing the option key allows the display of a target around the moving point.

- Profiler - allows one to show the histogram of the image gray levels along a line. First create the line and apply the Show Data command. It brings up a secondary window showing the profile histogram along the line. Clicking and dragging the cursor inside this secondary window allows to explore individal pixel values.

- Annotations - creates an annotation. Click on the image point to select the anchor point of the annotation. A dialog window will appear where you can define the annotation label. You can also add some comments. If you do so, the annotation will be followed by a small postit sign. Just click on it to open a postit window containing the attached comments. The combination option + mouse click allows the content of an annotation to be modified.

- Mover - provides another way to scroll and pan an image inside a window in addition to the scroll bars. Click and drag the mouse to move the image.
  On the Macintosh, option click allows to display a temporary pointer (a hand) (normally used with the remote consultation facility for cooperative work).

- Magn. Glass - this tools that imitates a magnifying glass provides a fast local zoom. It enlarges a portion of the image. The combination option + mouse click brings up a dialog window allowing one to change some parameters such as the shape of the glass, the magnifying factor or the inversion of gray levels (only for Macintosh).

## 6.7 Processing menu

The OSIRIS software has been designed as a general image manipulation and analysis software that can be used in different clinical implementations with some degree of customization. The functions and tools are divided into different categories:

General purpose image processing tools (Filters, Isocontours,...).
Specific image analysis tools (clinical tools).
Specialized processing tools.

The primary goal of OSIRIS was to provide a software platform for image manipulation available on different types of workstations. As this software has been designed to be used as a platform for further developments, it has to be easily expandable. This is why our efforts first focused on the platform itself. A limited set of tools has been implemented so far.

- Filters - a variety of filter functions including standard convolution filters (3x3, 5x5, etc.). Sets of predefined kernels for convolution operations are provided. Refer to Appendix 5 to know how to define your own filters.

- Isocontours - automatic segmentation of images using intensity isocontours. As for filters, isocontours are applied to a region defined with the selector tool.

- Multiplanar Sections - given a set of transverse slices, allows the reconstruction of coronal and sagittal planes. Refer to the next chapter for more information about this tool.

- Ejection Fraction - provides a semi-automatic calculation of the ejection fraction of the left ventricle. Refer to the next chapter for more information about this tool.

- Histogram Equalization - applies a contrast limited adaptive histogram equalization algorithm (CLAHE).

- Segmentation - region growing segmentation algorithm. Refer to the next chapter for more information about this tool.

# 7. Clinical tools

## 7.1 Multiplanar sections

This tool allows the reconstruction of coronal and sagittal planes from a set of transverse slices (at least 5 slices are required). The user can select the position of the different axes either by directly clicking and dragging the axes lines on the images, or by clicking on the different buttons of the cube at the bottom right of the window. The Save button allows the recalculated images to be saved in a Papyrus file.

Normally, this tool must be applied to a spatial series of images, but it can also be applied to a temporal series. If no information about the slice position is available, then the slice thickness is considered assuming slices are contiguous. If slice level and slice thickness are unknown, slices are distributed in the available space.

## 7.2 Ejection fraction

This tool provides a semi-automatic calculation of the ejection fraction of the left ventricle. The user must define some ROI's corresponding to different contours of the left ventricle, giving them some specific labels, and ejection fraction can be performed according to different algorithms. The definition of the different ROI's is done manually; automatic segmentation algorithms are under development. The assignation of predefined ROI's labels can be done manually or automatically with the Labels command of the Overlays menu. Five methods are provided for the ejection fraction calculation : monoplane, biplane, hemi-ellipse, Simpson and Teichholz. Results are displayed in a specific window.

Monoplane : calculated according to a single long axis view. Two areas and two lengths are necessary. Here, an area can be a polygon or an ellipse, and a length is made with the calliper tool. The four resulting ROI's must have the following labels: DiasLong for the diastolic long axis area, SystLong for the systolic long axis area, DiasLength for the diastolic long axis length, and SystLength for the systolic long axis length.

Biplane : calculated according to two long axis views (horizontal and vertical). Four areas and two lengths are necessary. ROI's must have the following labels : DiasHorLong for the diastolic horizontal long axis area, SystHorLong for the systolic horizontal long axis area, DiasVerLong for the diastolic vertical long axis area, SystVerLong for the systolic vertical long axis area, DiasLength for the diastolic horizontal long axis length, and SystLength for the systolic horizontal long axis length.

Hemi ellipse / cylinder : calculated according to a long axis and a short axis view. Two areas and two lengths are necessary. ROI's must have the following labels : DiasShort for the diastolic short axis area, SystShort for the systolic short axis area, DiasLength for the diastolic long axis length, and SystLength for the systolic long axis length.

Simpson : calculated according to a long axis and two short axes views. Four areas and two lengths of long axes views are necessary. ROI's must have the following labels : DiasMitral for the diastolic mitral valve area, SystMitral for the systolic mitral valve area, DiasPapi for the diastolic papillary muscle area, SystPapi for the systolic papillary muscle area, DiasLength for the diastolic long axis length, and SystLength for the systolic long axis length.

Teichholz : estimation calculated according to the diameter. Two diameters (lengths) : DiasDiam for the diastolic diameter, SystDiam for the systolic diameter.

## 7.3 Segmentation

Segmentation is the process of dividing an image into meaningful regions. For instance, in medical imaging, the interest is to identify organic structures like organs, bones, or tumors. Three methods are generally used to segment an image : thresholding, edge detection and region growing.

### Color mask

The thresholding method is certainly the simplest segmentation method. It consists in considering all pixels for which the distance to a reference point is less than the threshold value. Unfortunately, this method does not allow to identify one specific region. OSIRIS provides a way to segment according to this method with the color mask tool. This tool allows to colorize all pixels being in a certain range of values. The range, as well as the color, can be changed interactively. The result looks like a color wave that moves on the images.

This tool is intended to be used in association with the region growing tool (click on the ROI button to activate it). It allows to give a precise idea of the threshold that will be necessary for the region growing algorithm. Just be careful about the window settings, set the window width and window level to their default values (meaning to the minimum and maximum pixel values of the image).

### Region growing

The region growing segmentation method goups pixels into larger regions. The basic principle is to start with a seed point, and to grow a region by appending neighbors having similar properties such as gray level or texture. OSIRIS provides a region growing tool. The acceptance criteria is based on the grey levels. This tool generates a closed polygon that defines the segmented region. Procedure to be followed to use this tool :

- use the color mask to identify the region you are interested in, and click on the ROI button which will call the region growing tool. Though this step is not required, it is recommended.
- select parts of images : with the selector tool select a minimal region in order to optimize computation. If you deal with a set of images, you can use the shift key to propagate the region to all active images. The research will then be applied to all images. If you do not select a region, the research is done on the full current image.
- if you did not use the color mask, then you must manually call the segmentation tool in the Processing menu.
- display of a dialog asking you to give a seed (close the dialog window first).
- specify parameters
  Tolerance is automatically set if you used the color mask tool. You can modify it.
  Segmentation method :

         global   " x,y  Region, | x - y | Tolerance
         local    " x,y  Region, and x neighbor of y, | x - y | Tolerance
         min-max  " x  Region, and M region max, m region min, | M - m | Tolerance
         average  " x  Region, and A average of region, | x - A | Tolerance

  Connexity : gives the number of neighbors that are considered from a given point.
  Result : by default one seed and one closed polygon, but it is possible to look for multiple regions, in which case all points are considered as seeds.
  dimension : 2D or 3D growing.
  display : as the segmentation requires several steps to be performed, it is possible to visualize intermediate results.
- the final step is the generation of a (or a series of) closed polygon(s).

Example of ROI generated by region growing algorithm

Region growing dialog

# 8. Color manipulation

The most essential tool in medical image manipulation is the adjustment of contrast and intensity. The user should be able to adjust the contrast and intensity of an image interactively in real time. Selection of contrast through selected numerical values or on intensity histograms should be avoided and should be reserved for advanced users who want to use specific image processing features. Physicians need to be able to visually adjust the image contrast and intensity through some kind of interactive control tool.

OSIRIS provides two possibilities for color adjustment : either through direct manipulation of the mouse (easiest way) or through a specific dialog window (more complete adjustment features). All the adjustments are performed using the full original dynamic range of the images. Medical images may typically have 256 levels (8 bits coding), 1024 levels (10 bits), 4096 levels (12 bits) or 65536 levels (16 bits). The contrast and intensity adjustment allows the mapping of portions of the image dynamic range to the display monitor.

## Direct adjustment

Click on the interactive color adjustment button to allow a direct color adjustment with the mouse. The palette on the left side on the main window is switched to a specific palette as shown in the figure below. Click and drag the mouse into the window to adjust the window level (vertical movements) and the window width (horizontal movements). While dragging the mouse, adjustment is made directly on the color lookup table, then when the button is released the current image is effectively updated. All active images are then automatically updated by clicking on the OK button, .

Adjusting the window level alone does not normally affect the window width and vice versa. However, in certain conditions, one can affect the other. When shifting the window level to an extremity of the dynamic range, the window width is automatically reduced. When increasing the window width, if the low/high bound reaches the bound of the dynamic range then the window level is automatically adjusted. Thus, one can always take full advantage of the 256 gray levels for the display of the images.

Warning : do not make long displacements because interactive adjustments made on the color lookup table do not exactly reflect the real adjustment that will be made to the image itself. This is particularly true when increasing the window width or moving the window level. So, in most cases, the interactive adjustments are not very precise, they are helpful for giving an indication about the color adjustment, but one must release the mouse button to have the real adjustment. This is also true when adjusting colors with the color control dialog window.

## Color control dialog window

The Adjust Colors ... command of the Display menu displays a dialog window which allows adjustment of the colors (see figure below).

Compared to the previous tool, this one is more complete. Adjustment can be made either through two cursors that can be freely moved along a color scale to select the highest and the lowest intensity value, or by modifying interactively the values of the window level and/or the value of the window width. The Intensity tables popup menu allows the use of predefined settings and to save new ones. The Color tables popup menu allows the use of different color lookup tables. In this case the new colors are applied to all the screen i.e. to all the OSIRIS windows.

## Image dynamic range versus displayed dynamic range

The dynamic range of some images may often exceed the dynamic range of intensity levels that can be displayed at one time on a screen. The software performs an optimal mapping of the image intensity values into the display range. Typically medical images have an intrinsic dynamic depth range of up to 12 or 16 bits while most of the common display systems support 8 bit displays that allow only 256 levels to be displayed simultaneously on the screen. Interactive adjustment is made in real time on the available dynamic range of the display (typically 256 gray levels) and when done, the image in its full dynamic range is remapped on the screen.

## Real time adjustment

Because images displayed in different windows could be used for comparative evaluations, each window is separately adjustable. Due to hardware constraints, it is not often possible to perform this adjustment in each window individually in real time. It was therefore decided that in some configurations the real time adjustment will affect the whole screen (including all the windows displayed on it) and when done, only the active window (the topmost in the stack of windows) will be readjusted to match the settings that were selected interactively.

## Color lookup tables and intensity settings

A set of predefined linear and non-linear intensity transformation functions are also selectable via the Intensity tables popup menu. The current setting (lowest intensity, highest intensity and current intensity transformation curve) can be saved with the Save... item of the Intensity tables popup menu. It is possible to select either the relative mode or the absolute mode in the Save... dialog. The default value is set to the relative mode. The absolute mode can be very useful in the case of well calibrated images, such as CT images. For more information about these two ways of saving a setting, see Appendix 6 (relative versus absolute mode). The saved intensity setting appears subsequently as an item in the popup menu and can be restored upon request. It is also possible to create a custom intensity setting file (see Appendix 4). One has the choice to display the images in greyscale or in pseudocolor scales via the Color tables popup menu. Sets of standard as well as custom color lookup tables (CLUT) are available. Customized color tables can easily be defined by the user (see Appendix 3). Black saturation is also selectable. This option allows one to black out the pixels which have a higher intensity than the maximum intensity selected on the control panel.

# 9. Overlays

OSIRIS provides the possibility to add overlay objects to images. Overlays can be annotations or ROI (Regions Of Interest). Overlays can be saved together with their image in the same PAPYRUS file.

To create an overlay, one must use the tools provided by the Tools menu or by the Tools button of a main OSIRIS window. The next figure gives an example of a few overlays.

Examples of overlays

When one creates an ROI, an annotation is automatically added to it containing the label ROI-# where # is a sequential ROI number. This type of annotation attached to an ROI can be changed, moved or deleted like a normal annotation. All operations applied to an ROI are also applied to the associated annotation but the inverse is not true (if you move or delete an ROI, the attached annotation is also moved or deleted, but if you only move or delete the annotation, the ROI does not change).

To delete overlays, select the desired overlays and press backspace on the keyboard or apply the Cut command of the Edit menu.

## Overlays selection

Selected overlays can be moved, resized or deleted. To select an overlay, click on it with the mouse button in the neutral tool mode. For an annotation click on the label, for a rectangle or an ellipse click in the region it defines and for a polygon, click on one of its line segments. A selected overlay is highlighted by small square symbols corresponding to the rectangle containing the ROI. In the case of a polygon all the points of its contour are also highlighted. In the case of an annotation, the anchor point (end of the pointing arrow) is also highlighted.

## Annotation modification

To change the contents of an annotation (text label or text comments), use the combination of the option key with the mouse button when selecting the annotation. It brings up the same dialog window as used at the creation of the annotation.

## Move

Once selected, an overlay can be moved by clicking on it (but not on a highlighted point) and dragging it with the mouse to a new location.The combination of the option key with the mouse click allows one to restrict movement horizontally or vertically. For an annotation one can move either the anchor point or the text label. Overlays can also be moved with the four arrow keys on the keyboard. Do not forget to first select the overlays to be moved.

Remark: do not click and drag a highlighted point, this will resize the ROI.

## Resize

A selected overlay can also be resized (except for annotations). Click and drag one of the highlighted points. The combination of the option key with the mouse click allows one to keep the original proportions of the resized object. For a polygon, you have the choice to resize the polygon entirely (click on one corner point) or just one point of the polygon (click on that point).

## Settings

You can change the attributes of overlays with the Settings command of the Overlays menu. The following dialog window will appear:

If you click OK, your changes will be applied to the selected overlays of the current image. If there is no selected overlay, your changes will be applied to the default settings that are automatically used when you create a new overlay. The default settings are automatically saved in the Preferences file.

The smooth setting allows to smooth a closed polygon. Straight lines between points are replaced by spline curves.

## ROI data

For each closed ROI and profiler line, statistical data is computed and can be displayed with the Show Data command of the Overlays Menu. A separate window is displayed (see figure below) where statistical data as well as the histogram of color levels of the ROI are displayed. The green line on the histogram indicates the mean value. Data can be saved in a separate text file in order to be reused for statistical analysis for example.

Example of a closed ROI data window

Example of a data window associated to an ROI created with the profiler tool

## Multiple ROI data

The Multiple ROI Data command displays statistics about the maximum, minimum, and mean pixel values and the area of a closed region of interest over several images of a set. One needs to first create a closed ROI (rectangle, ellipse, polygon) and to copy it to other images. Then one can modify the size and the location of each one independently (but do not change the label). To apply the Multiple ROI Data tool just select one of these ROI's and select this command. The system will look at each image of the set for an ROI with this same label. It then computes the data for each overlay and displays the results in a data window.

Example of a data window associated to the Multiple Roi Data command (you must first select a closed ROI present in several images)

## Multiple ROI volume

It is possible to compute the volume of an object specified by a series of ROIs over a set of images. ROIs must have the same name. To activate this tool, you must first select one of the ROIs. The following data window gives you :

- interactive 3D representation of the ROIs (rotation around x and y axes is possible by clicking on the buttons in the window, option click allows to extend the Z axis),
- schema of the ROI of the image selected below,
- interactive area graphic where it is possible to select an image in the set of images having this ROI,
- statistic area giving some information about the current slice and ROI area.

# Appendix 1 : File organization

To use OSIRIS, files must be organized in the following hierarchical file structure (except the Images directory, that can be anywhere) :

The OsirisPrefs folder contains different types of files defining, for example, color lookup tables (file extension .lut) and intensity level settings (file extension .its). Each user can define his own color lookup tables and his own intensity level settings, please refer to Appendix 3 and Appendix 4. The OsirisPrefs folder must be in the same directory than the Osiris application.

The PrefFilters file contains the definition of convolution filters (see Appendix 5).
The PrefStudyReport file contains a template of a medical report. It will automatically be used when creating the text report associated to an image file.
The PrefOverlayLabels file contains predefined labels that can be used for overlays.

The Preferences file contains the position of the color control dialog window, the different zoom factors (10 values in growing order) and a flag indicating if the log facility is on or off (see Appendix 7). On the Mac version an additional flag indicates if the flush mechanism will be used or not. The flush mechanism allows to spare memory by flushing the images of the inactive windows to the hard disk, thus allowing to have more windows open at the same time.

Example of a Preferences file :

    ColorPanelPosition originX originY	ColorPanelPosition 100 100
    Zoom val1 val2 ... val10	Zoom 10 25 50 75 100 150 200 300 400 500
    LogFile on/off	LogFile on
    Initial display mode (stack/tile)	DisplayMode stack
    Patient name when saving (show/hide)	PatientName show

# Appendix 2 : Data Import/Export (File Formats)

## Input formats

By default, OSIRIS works with images stored in the PAPYRUS file format (version 2 and version 3). It can also read simple DICOM images.

The Macintosh version of OSIRIS can also read images stored in other formats such as PICT, SPI, or raw data. In the case of PICT images, OSIRIS requires the files to have one of the following types:

"PICT" for a simple PICT file (image stored in the data fork).
"gray" for a file containing a single PICT image stored in the resource fork.
"movi" for a file with multiple PICT images stored in the resource fork.

OSIRIS provides also the possibility to read images as raw data files. To read an (uncompressed) image, or a set of images, stored in a raw data file, one must indicate the width and the height of the image, and the size of the file header, if any. One can precise the number of bits used for coding a pixel.

Structure of files that can be read with the raw data reading facility

## Output formats

As for input formats, all versions of OSIRIS allow to save sets of images in the PAPYRUS file format (version 2 and version 3).

The Macintosh version allows also to deal with PICT files. Two possibilities are provided to make a PICT image from images displayed with OSIRIS :

- the Export PICT command from the File menu (see figure below)
- the Copy command from the Edit menu

  ## Copy - Paste

  The easiest way to export an image is by using the Copy-Paste method which makes a snapshot of the screen that can be imported by any other application accepting PICT images such as text editors or graphic editors.

  Within OSIRIS, the Copy command copies the content of the current image window, as it appears on the screen, taking into account :

  - zoom factor,
  - cropping region,
  - overlays,
  - selector,
  - stack/tile modes.

    Example of a snapshot (tile display mode, cropped region, 75 % zoom factor, ...)

    It is possible to use the selector tool to define a region to copy. In tile mode it will only copy the selected part of the current image. To copy all images, apply the Crop command first.

    Just be careful that no overlay is selected, because the Copy command will only copy the overlay.

    ## Export PICT

    Another way to export an image is to create a PICT file with the Export PICT command. The PICT image can be created from the displayed image ("As displayed" default option) or from the original data ("customized" option). By default, it is similar to the Copy command, it makes a snapshot of the current Osiris window.

    For some specific usage (higher quality printing), it is interesting to have different options allowing a different resolution or a different zoom factor. If the "customized" option is selected, then the zoom factor and the resolution can be modified. Choosing a resolution of 200 dpi allows to generate a file that will be directly printed on a 200 dpi printer. Another example is the need for an enlarged image (zoom factor greater than 100%) but with a high quality (bilinear interpolation). In these cases, the PICT image is generated from the original data, and the overlays are ignored.

    Dialog of the Export PICT menu command

# Appendix 3 : Color lookup tables

Each user can define his own specific color lookup tables. A color lookup table (clut) is defined by 256 entries, each entry being defined by 3 values: RGB (Red Green Blue) that can vary from 0 to 65535. These values can be given directly as a 16-bit value or as a multiple of 256.

## Installation

- create your color lookup table.
- write it in a file with the extension .lut.
- put this file in the ColorDir directory inside the OsirisPrefs folder.
- your color lookup table will be loaded automatically when you start the OSIRIS application and it will appear as an item in the color scale pop-up menu of the color control panel (Color Adjust command of the Display menu).

## Syntax

- the first character of a line indicates the contents of this line; it must be followed by a space.
- the character * indicates a comment.
- S or L defines an entry in the clut. It must be followed by a number in the range [0, 255] indicating the entry of the clut. The 3 following values correspond to the RGB values.

  If S (Small) the 3 RGB values are a multiple of 256.
  If L (Long) the 3 RGB values are effective values.

  Example of a definition of the 3rd entry of a clut:

            S 3 0 20 255  =  L 3 0 5120 65280

## Example

    * Example of a color lookup table
    S 255 0 0 0
    S 254 5 0 11
    S 253 11 0 22
    S 252 17 0 34
    S 251 22 0 45
    ...
    S 5 181 0 0
    S 4 178 0 0
    S 3 176 0 0
    S 2 174 0 0
    S 1 255 255 255
    L 0 65535 65535 65535

If an entry is defined several times, only the last definition will be taken into consideration.

# Appendix 4 : Intensity settings

Each user can define his own specific intensity level settings. An intensity setting is defined by the current minimum and maximum of the image either saved as relative values (in the range 0..255) or as real values (real range) and by the intensity transformation table : a 256 entries array containing values in the range 0..255.

# Installation

- create your intensity transformation table, with a maximum and minimum value.
- write it in a file with the extension .its
- put this file in the ColorDir directory inside the OsirisPrefs folder.
- your intensity settings will be loaded automatically when you start the OSIRIS application and they will appear as items in the intensity setting pop-up menu of the color control panel (Color Adjust command of the Display menu).

## Syntax

- the first character of a line indicates the contents of this line, it must be followed by a space.
- the character * indicates a comment line.
- the character A indicates that the minimum and maximum values are stored in absolute mode; as the character R indicates that they are stored in relative mode. You have to put one of these two characters before putting the minimum and maximum values.
- the character L indicates the minimum intensity value.
- the character H indicates the maximum intensity value.
- the character C indicates a curvature factor. It may be followed by 2 numbers in the range 0..255; the first one indicating the position in the array and the second one the corresponding value.

Example of definition of the 5th entry of an intensity transformation table

    		C 5 35

## Example

    * Example of an intensity setting
    R
    L 12
    H 237
    C 0 12
    C 1 13
    C 2 15
    	.
    	.
    	.
    C 255 245

If an entry is defined several times, only the last definition will be taken into consideration.

# Appendix 5 : Convolution filters

Each user can define his own specific convolution filters. A filter is defined by a name and a matrix 3x3, 5x5, or 7x7.
The number of filters is (arbitrarily) limited to 20.

## Installation

- create your filter file containing your filters, and call it PrefFilters.
- put this file in the OsirisPrefs folder.
- your filters settings will be automatically loaded when you start the OSIRIS application.

## Syntax

- the first character of a line indicates the contents of this line, it must be followed by a space.
- the character * indicates a comment line.
- the character F defines a bidimensional convolution filter with a name and the size of the matrix.
- the character Z declares a (unidimensional) interslice convolution filter, a name must follow, no size is required because size is predefined to 3.
- the character D indicates a line of data: "size" integers.
- spaces are not allowed in a filter name.

## Example

    * Example of PrefFilters file
    * Filter sharpen (3x3) used to ...
    F MyFilter1 3
    D 0 1 0
    D 1 1 1
    D 0 1 0
    *
    * Interslice convolution filter
    Z Interslice_Smooth
    D 1 2 1
    *
    * Second Filter (5x5)
    F MyFilter2 5
    D 0 1 0 0 0
    D 1 1 1 0 0
    D 0 1 0 2 3
    D 1 1 1 0 0
    D 0 1 0 2 3

# Appendix 6 : Relative versus absolute color mode

The choice between the relative or the absolute display mode appears in two different situations:

## A - Displaying a set of images

### Real image versus displayed image

The dynamic range of an image (real image) can vary from a few different greyscale levels to more than sixty five thousand different grey levels. The dynamic range of the displayed image is 256 levels. Because of hardware constraints on most computer systems, it is only possible to display 256 different grey levels simultaneously on the screen. Thus, a conversion is necessary to transform the real dynamic range to the displayed dynamic range.

Remark: the dynamic range of an image corresponds to the number of different colors of the image (which are normally grey levels for medical images).

To calculate the conversion function one must find the slope and the offset of the line passing by the 2 following points (max, 255) and (min, 0). They are given by the following equations:

    	255 = max * slope + offset
    	  0 = min * slope + offset

Conversion from real dynamic to displayed dynamic

Remark: max indicates the highest intensity (maximum pixel value) of the image and min the lowest intensity (minimum pixel value) of the image.

When the contrast and the intensity are modified, the minimum and maximum values are changed and a new conversion is necessary.

### Problem

All the images of a set do not necessarily have the same minimum and maximum pixel values. If the conversion function is not the same for all images in a set, then the 256 values of one displayed image does not correspond to the same pixel values in another image. This means the same gray level does not correspond to the same pixel value among images of the set. In order to be able to precisely compare different images of the same set it is important to be able to set the conversion so that the same colors indicate the same pixel values. This is why 2 modes are possible: absolute and relative.

### Solution: absolute versus relative display mode

The images of a set can have different minimum and maximum pixel values. One can either choose to display the images converted using their own minimum and maximum (relative mode), or choose to have them displayed using the minimum and maximum values of the set (absolute mode) for the conversion. To change the mode, use the Color Adjust. Mode command of the Display menu.

Figure 2 : Display of a set of images

In the relative mode the full dynamic range of the display is used to display each image. In the absolute mode the same color (greyscale level) indicates exactly the same pixel value.

Remark: the image maximum value is not necessarily different from the set maximum value. Idem for the minimum value.

## B - Using a predefined intensity setting

The choice between relative and absolute mode also occurs when saving an intensity setting. At this point the user gives a name for this setting and indicates if this setting is relative or absolute.

### What happens when adjusting the contrast and the intensity

When using the color control window to adjust the contrast and the intensity (also called the window width and the window level), we just change the values of the highest pixel value and the lowest pixel value used for the conversion to 256 grey levels. Then we recalulate the conversion function in order to display the image according to this setting.

Conversion from real dynamic range to displayed dynamic range

All the pixels which have a higher value than the displayed maximum value will appear white, while all the pixels which have a lower value than the displayed minimum value will appear black.

### Problem

Using a predefined intensity setting corresponds to setting the minimum and maximum to predefined values. When saving such an intensity setting, what must be saved? The absolute values (displayed minimum, displayed maximum) or the position of these values relative to the minimum and maximum values of the image. Both options are required.

### Solution: absolute versus relative mode

Absolute setting: the real values of the lowest and highest displayed intensities are saved. This is useful in the case of calibrated images, such as CT and MRI images. These values are then used as minimum and maximum values for the calculation of the conversion function.

Relative setting: the position of the lowest and highest displayed intensities relative to the real lowest and highest intensities of the image is saved. It is used to emphasize certain parts of the dynamic range of the images, whatever modality or color range they might have.

### Example

The first figure describes an intensity setting to be saved as well as 3 different images on which this setting should be applied. The second figure shows the result if the setting is saved as absolute, whereas the third figure shows the result if the setting is saved as relative.

Remark: the maximum values correspond to the white color and the minimum values to the black color.

## C - Combination of the two previous situations

If an absolute setting is used, then the display mode is not important because the minimum and maximum displayed values are absolute values and do not depend on other values.

If a relative setting is used then the display mode determines which minimum and maximum values are considered for the calculation (minimum and maximum value images or set minimum and maximum values).

# Appendix 7 : Log file

The Log File facility records most of the user's actions during an OSIRIS session, and saves them in a file.

## How to activate the Log File facility

To activate this facility, set the LogFile variable to on in the Preferences file of the OsirisPrefs directory (Example : LogFile on).

Each session is then recorded in a file (created in the LogFileDir of the OsirisPrefs directory), the name of which follows the rule LogFile-ddmmyy-hhmm where ddmmyy means the date and hhmm the time of the beginning of the session.

Example of a log file: LogFile-920922-1920 (created on 22nd of September 92 at 19H20)

    Action                         begin	end	 duration

    Locate                         19:21:13	--	 --
    Locate                         19:21:14	--	 --
    Open CerebAVM_MRI1.pap (11)    19:21:06	19:21:23 0:17
    Front CerebAVM_MRI1.pap        19:21:22	--	 --
    Tile Mode                      19:21:28	--	 --
    Stack Mode                     19:21:36	--	 --
    Zoom In                        19:21:38	--	 --
    Zoom Out                       19:21:39	--	 --
    Movie Start                    19:21:41	--	 --
    Movie Stop                     19:22:05	--	 --
    Locate                         19:22:15	--	 --
    Open Cerebr_Angio.pap (11)     19:22:26	19:22:37 0:11
    Front Cerebr_Angio.pap         19:22:38	--	 --
    Locate                         19:22:42	--	 --
    RoiRect                        19:22:49	--	 --
    Angle                          19:22:57	--	 --
    RoiProfiler                    19:23:01	--	 --
    RoiAnnotation                  19:23:09	--	 --
    Front Cerebr_Angio.pap         19:23:10	--	 --
    Tile Mode                      19:23:15	--	 --
    Locate                         19:23:18	--	 --
    Invert CLUT                    19:23:21	--	 --
    Invert CLUT                    19:23:22	--	 --
    Stack Mode                     19:23:31	--	 --
    Movie Start                    19:23:33	--	 --
    Movie Stop                     19:23:45 --	 --
    RoiAnnotation                  19:23:49 --	 --
    Front Cerebr_Angio.pap         19:23:50 --	 --
    RoiAnnotation                  19:23:51 --	 --
    Front CerebAVM_MRI1.pap        19:23:52 --	 --
    Close Document                 19:23:56 --	 --
    Front Cerebr_Angio.pap         19:23:56 --	 --
    Adjust Colors                  19:24:07 19:24:14 0:7
    Front Cerebr_Angio.pap         19:24:14 --	 --
    Rotate 180                     19:24:28 --	 --
    Close Document                 19:24:37 --	 --
    Osiris                         19:20:46 19:24:41 3:55