Tracheal Stenosis

written by Janice Cook-Granroth



Table of Contents

Loading Images
Calculate the Half-max
Segmentation
Interpolation
Making Measurements
Surface Rendering

Loading Images

If the image data is not on your computer, you will need to transfer the data to disk before you can load it into shared memory. For more explicit instructions, please see the Tape Utilities section.

Visualizing the Airways: Display Colors and Contrast

To enhance the ability to view the lung structures, you may wish to change the display colors. For more explicit instructions, please see the Color Scales section.

LOAD DATA FROM DISK TO SHARED MEMORY

The data that was loaded to the diskspace now needs to be loaded into Shared Memory so the other VIDA programs may used the data. On the VIDA main panel select LOAD IMAGE DATA. This opens the LoadAnalyze Format (LAF) panel. Next, select the directory and then left click on the file to be loaded.

Now, under the view button select the Histogram/Sample panel with the right mouse button.

If memory is limited then do the following steps, otherwise skip the next step on conserving memory. To conserve memory and time when analyzing the data the user need to select the region of interest by drawing a box around the trachea. The box needs to be big enough to include the trachea on all slices and preferrable a square. Also, the box dimensions need to be a multiple of eight in order for the interpolation program to work. Click on the set optionsbutton to save the box dimensions. To check the dimensions of the box by bringing up the LAF:Properties panel. Click on the Y button for the Slider Control buttons. Note the start value and the number value. The number value should be divisible by eight. Now click on the X value. The number value should be the same as the number value for Y. If they are not but are close the user may retype in a new value for either. Please note the start value and the number value for the X. If there are more slices than the needed for analyzing the trachea click on the Z button. Now type in the start slice number on the start line and type in the number of slices to include on the number line. Now, under the view button select the Histogram/Sample panel. On the slice no. line start with slice one and view the slice. Increment through the whole data set viewing the trachea to see if the trachea is contiguous or jumps. If the trachea jumps between slices then the user needs to create a new image file which the trachea become contiguous. For more information on shifting the non-contiguous trachea.

Now the data set may be ready to load. First, left click on the propertiesbutton and bring up the LAF:Properties panel. Locate the "16 to 8" bit button and left click on the button. A check box should appear in the box. This will convert the data from a sixteen bit data image to an eight bit data image. Many VIDA modules work better with eight bit data images. Now activate the Load Image Data button and load the trachea data set. This will load the file into shared memory. For more explicit instructions, please see the Loading Image Data section.

Calculate the Half-max

Now figure out the half max of the air to use this value for the threshold in 2D-Seg. First, select Analysis from the main VIDA panel with the right mouse button bringing up the list of options. Select Region of Interest. Second, a line was drawn from the inside of the lumen past the inner wall of the airway. Move to the ROI:Region Properties panel and select line from the create window. Move the curser to the main Region of Interest window and place a line accross the airway extending over on both sides. Now move to the ROI: Stats panel and select point from the stats for menu. Also select slice number and the value items from the statistics window. Using the ROI Graph panel select intensity cross option from the graph types menu and measure point from the measure menu. Also select the current button from the slice choices. Left-clicking on the graph, causes a line to appear. Next, one must drag the line so it falls half way between the minumum and maximum of the graph for each side, the "half-max". Once the left mouse button is released the value at that point will be recorded in the ROI: Stats panel, which is the half-max for the airway wall. Several half max measurements were made on different slices. An average of the half-max for each data set was calculated seperately and used as the threshold for segmentation. Now close the Region of Interest program.

Segment Out the Trachea

Next select the 2D Segmentation item under the Image Manipulation button on the VIDA main panel. Select the File button and bring up the 2DS:Select Volume panel. Select input from the Volume area. Next choose the file from the scroll area and then select Load/Select and answer the questions. Next, open the tool kit item under the properties button. Use this panel to segment out the trachea from the rest of the data in the scan. First dim any pixels in the 254-255 range (like the bone) so the 255 value may be use to segment the airway. Select the auto button in the paint modes section. Select the retangle button in the oject section. Select the multiplier option in the paint operator section and type in "75" on the % line.

Now on the main 2D Segment window, use the right mouse button and click and hold on the Properties button and select Magnification. This brings up the 2DS:Magnification Panel. The default magnification is 100%. Reduce this down to a value of 80% or lower using the slide bar or typing in the value at the %% x and y line. Now return to the 2D Segment main window and place the left cursor at the top left corner of the image and hold the cursor down and drag the cursor to the bottom right corner of the image and then release. This draws a rectangle around the image. On the 2D Segment main window select mask copy under the edit button.This brings up the 2DS:Mask Copy panel. Use this panel to copy the 75% feature through the whole data set. Select current slice under the paste from buttons. Select range of slices under the paste to buttons. Select slice from the paste range. Next, type "2" on the start line and type the last slice number on the end line. Select COPY MASK and then the paste mask buttons in that order and the rest of the data set will be processed. When the PASET MASK button un-greys, then the copy is complete. Quit this panel.

Go back to the 2DS:Tool Kit panel and select fill-2D option under the object box. Have the input selected under the Fill On title and the less than value from the box under the Comparison title. On the Value line type in the calculated half-max value. Select fixed value under the paint operator section. Type 255 on the fixed line.

Now move the cursor over the trachea on the 2D Segment main canvas and click the left mouse button. The trachea will go from black to red and then to white. Move to the next slice by using the + button and continue to move the mouse over the trachea and click. Continue until all the slices are done. If you make a mistake select the Undo button before continuing onward. Next select the file button. To save the segmented file to a new file select the File button on the main panel. This brings up the 2DS:Select Volume panel. Choose Output button from the Volumesection. Type a new file name on the File line. Choose the Local Mem item below. Next, select the Save to File button. When the Save to File button become un-greyed then the file is saved. Close the 2D Segmentation program.

Interpolate the Segmented Data Set

Now go back to the VIDA main panel and under the image manipulation button and select Shape-based interpolation. This is used to interpolate the data set before making the needed measurements. First select the from button select the directory and the filename of the saved 2D-seg file created above. The filename should appear on the name line. Next, select the to button and choose the directory and type the name for the soon to be created interpolation file to be called on the name line. Now select the define objects button and bring up the define objects panel. Type on the min and the max line the value of the airway which in this case is 255. Next type on the value line the output value which in this case is 255. Now select the apply button. Return to the multi-shape base interpolation panel and select the interpolate button. The program should now start interpolating the 2D-Seg input file and produce the new output file.

Make the Measurements

Use the Memory Manager option to delete the previous data files. Then on the VIDA main panel select LOAD IMAGE DATA. Select the directory and then left click on the interpolated file and load the file. Also load the original file as an eight bit data set. Return the the VIDA main panel and click with the right mouse button and hold on the Analysis button to bring up the menu. Bring the mouse cursor over the Tube Geometry menu item.

Finally, time to make the measurements on the trachea. Press and hold on the file button and move over to the right on the load item and choose load images. This brings up the TGA: Select Volume panel. Select the interpolated file for both the original image and the segmented image. Press the orientation button to bring up the define orientation panel. Change any of the needed variables by depressing the buttons and selecting the correct criteria. Then select the apply button. Now move back to the TGA: select volume panel and select the display button.

This will bring up four windows...tranverse projection, sagittal projection, coronal projection, and define centroid. In one of the projection windows, place the mouse at top and center of the spot on the airway to be measured and click. A dot should appear.( If not then go to the VIDA main panel and select color scales. In this panel set colors change the active box to number two and then press and hold on the color list button and change the color to one that the dot is visible.) In the same projection window, place the mouse at bottom and center of the spot on the airway to be measured and click. A dot and a line between the dots should appear in all three projection windows. Center the line in the other projection windows by placing the mouse over the dot and press down on the button and drag the mouse to center it and then release the mouse button. On occassion one of the projection windows will not have the line in the middle of the airway...this is fine.

Move to the TGA: define Centroid panel and select bisection for centroid algorithm. Select the proper tube color min and max. Select the number of obliques to create. Select bilinear for the interpolation. Then select the calculate button and the interpolation of the airway will be done. When the calculation is done the line in the airway changes to a dotted line. Check to see that all the dots fall within the airway, if not terminate this Tube Geometry session and start a new one in order to get correct measurements.

Now move to the Tube Geometry Analysis main panel and depress the calc button and select graph. The graph will be displayed. To display only the tube area select the properties button to bring up the TGA: Graph Properties panel. Click on the AP length, the Lat length, the normalize and the apply buttons in that order. Clicking on any point on the graph will cause a line to appear on the graph and in any projection windows that are displayed. The lines correspond to the point on the graph and the area on the trachea in the projection windows. This way the user may know where the measurement was taken from.To print or save the graph to a file use the print button on the TGA: graph display panel.

To see a list of the measurements move the cursor back to the TGA main panel and select statistics. A new panel is displayed with the slice number, area, anterior-posterior length (ap), lateral length (lat) and position. A copy of this may be sent to the printer by moving the mouse over the options button on the TGA: stats panel and holding the right mouse button down select print. To save the statistics to a file move the mouse back to the TGA main panel and hold the right mouse button over the file button and drag it over the save option and select save tables. This brings up the TGA: save tables panel. Type in the directory and filename for the statistics to be save to and then select the save button.

Surface Rendering (Making a 3D picture of the airway.)

The surface rendering program in VIDA needs to have the data set oriented from foot to head. For data sets that original scan head to foot use the Image Flipper program to make the data slices go foot to head.

The Image Flipper program is located on the VIDA main panel. Place the cursor on the File Manipulation and hold down the right mouse button. Select Image Flipper. This will bring up the image flipper main panel. Select Input from the File buttons. Select Dsk from the Origin buttons. Select Z from the Flip buttons. Either use the Dir line and the File line to select the 2D Seg output file that was created previously or use the scroll area with the files listed and select the file. Next, select the Output button from the File line. By default, the program displays an output filename on the File line that is the input filename with "_flip" following it. One can use this name or create a different one. Next, select the Go button. The data set is being created. When the program is done, the words "Done Processing" will appear at the bottom of the panel. Close this program when done.

Now, return to the VIDA main panel and place the cursor on the Visualization button. Hold the right mouse button down and select Surface Render. This will bring up the Surface Render main panel. Using the right mouse button hold down the File button and select Select volume/Extract edges. This brings up the Surface Render: Extract edges panel. At the bottom of the panel select the Select Volume button. This brings up the Surface Render: Select Volume panel. Select the disk button. Either type the directory and filename of the foot to head data set or use the scroll area to select the file. Return to the Surface Render: Extract edges panel. On the min line type one value less than the value used for the 2D Segmentation of the trachea. (For example, if in 2D Segmentation the value 255 was used for the trachea, then the min value would be 254 and the max value would be 256.) On the max line type one value greater than the value used for the 2D Segmentation program. Now, select Define Object button. For the Smoothing Factor select 1, 2, or 3. For Extraction Option select interpolate. Next, select Extract Edges. Wait for the done message to appear at the bottom of the panel.

Now, move the cursor to the Surface Render main panel. Right click on the Edit button and select Rendering Parameters. This brings up the Surface Render: Parameters panel. On the X line type 90 and hit return. Select the Apply button. Select the Render button. The trachea will appear in the Surface Render main panel. Right click on the File button and select Save Edges in order to save the surface render trachea (the edges as it is called.). This will bring up the Surface Render: Save Edges panel. On the Edge File Name: line type a name to save the edges. The next time one wants to view the edges, select Load Edges under the File button.

One can rotate the trachea image by using the Surface Render: Parameters panel and typing the angles in the X, Y, and Z lines, selecting apply and then selecting the Render buttons. Please note that the angle values are additive. For example if the first time one sets X to 90 and Y to 45. The angle displayed is X=90, Y=45, and Z=0 after the apply button has been selected. The X, Y, Z lines will read 0 though. The angle is displayed at the bottom of the panel. So if one type 45 on the Y line and selects apply, the true angle displayed will be X=90, Y=90, and Z=0. To start over with X, Y, Z equal to 0, please select the Zero button and then the apply button and then the render button.

Next save an image file of the rendered object (the trachea), depress the Edit button with the right mouse button and select Movie Maker. This brings up the Surface Render: Movie Maker panel. Select the Movie Script button. This will bring up the Surface Render: Movie Maker script panel.

The following directions will produce a image file of the surface render object with X = 90 degree and rotating every 10 degrees about the Y axis. On the Total Frame Number line type 37. Next select the Select Objs button. On the Frames lines type 1 on the first line and 37 on the second line. In the Select Objects to be Render box select the object and then click on the Apply button on the bottom of the panel. Next select the Rotate X button. On the Frames lines type 1 on the first line and 1 on the second line. In the Relative Rotation about X-axis box type 90 on the Increment line and the click on the Apply button. Next select the Rotate Y button. On the Frames lines type 2 on the first line and 37 on the second line. In the Relative Rotation about Y-axis box type 10 on the Increment line and the click on the Apply button.

Now place the cursor on the File button and click with the right mouse button and select Save Script. This brings up the Surface Render: Movie Control panel. Type in the directory and the filename on the file to call the script.

Now move back to the Surface Render: Movie Maker panel. Select Disk from the Destination buttons. Type a filename for the image on the Filename line. Next, place the cursor on the Output Dimension checkbox and with the right mouse button select 512x512. Next, select the Generate button.

Viewing the movie.

The surface rendered image is now save to a file and can be loaded with Load Image DATA from the VIDA main panel. To view the movie, place the cursor on the Visualization button and using the right mouse button select Movie Viewer. This brings up the Movie Viewer main panel. place the cursor on the File button and using the right mouse button select Load Image. This brings up the Movie: Load Images main panel. Select the file and them select the Apply button. This brings up the Quick Viewer. Select the play button << or >> to play the movie. Or to view one frame at a time select either < or > button. One may use another program to make screen dumps of the image in order to use the image in a report.


VIDA Tutorial Sections Relevant to the Tracheal Stenosis Measurement Application Tutorial

You may find it helpful to review the relevant VIDA tutorial sections.
Tape Utilities
Loading Image Data
LAF:Properties
Color Scales
Shared Memory
Region Of Interest (ROI)
ROI:Region Properties Panel
ROI:Magnification Panel
ROI:Graph Panel
ROI:Edit/List Regions Panel
ROI:Stats Window
Sequencer
2-D Segmentation
2-D Seg: Tool Kit
2-D Seg: Select/Volume
Multi-object Shape Based Interpolation
Multi-object Shape Based Interpolation - Define Objects Panel
Tube Geometry
TGA: Select Volume
Display/Calculate Centroid
TGA: Graph Properties
TGA: Statistics
Surface Renderer
Surface Render:Select Volume
Surface Render:Movie Maker panel
Movie Viewer





©1994-2002 Division of Physiologic Imaging, Dept. of Radiology, Univ. of Iowa


Bronchoscopy | Tutorials | DPI Homepage | VIDA | NLM | Contact Us | Search



Last modified: Wed Apr 3 09:22:24 CST