Target Outcome

The goal of this data analysis specification is to provide tissue thicknesses of skin, fat and muscle for both in vivo and in vitro experimentation. The output data can then be used for modeling purposes, statistical data analysis, and comparison to MRI and CT thicknesses.

Prerequisites

Infrastructure

Previous Protocols

Requirements

Procedures

Ultrasound Thickness Analysis

Thickness Analysis Software

Version 1.0 places red circles at the coordinates of the previous frame that was analyzed, starting with the second frame. Version 1.1 moves red circles to the location with the closest matched distribution to the coordinates in the previous frame, starting with the second frame. Version 2.0 does not require the user to hit 'enter' to save the thicknesses and allows the user to cycle through all of the locations for one subject instead of restarting the program after each location.

  1. Setting up the Directory
    1. Download and unpack the desired Subject ID folder, make sure you use the 'associated' data if you do not want to associate the files yourself.

      Note: If you have just completed the file association, confirm that the dicom and tdms files within the Ultrasound and Data folders have been matched (should begin with a three digit number) and that the corresponding deltaT values (as xml files) are located in the TimeSynchronization folder.

  2. The folder/file configuration should be the following
    • MULTIS###-# (Subject folder containing all data - the required data for the thickness measurements is shown below)

      • Configuration - Contains subject xml file for accepted trials

      • Data - Contains tdms files

      • Ultrasound - Contains dicom files

      • TimeSynchronization - Contains xml files with deltaT values for matched trials

  3. Required Python scripts
    • TA_sfm_v#.#.py

    • tdsmParserMultis.py

    • XMLparser.py

    • Plot_thicknessForce.py

  4. Running the manual thickness measurement script
    1. Install libraries as needed
    2. Change the directory to match where the Python scripts are located
    3. Run script
      • The first dialog window will allow you to select the Subject folder (you may also choose to hard code the path to the Subject folder, found within the getFiles() function)
        • Browse through to find the location of this folder and click 'ok'
      • A list will appear in another window which will show all the trials for that subject (you may have to scroll down to see the entire list)
      • Double-click on the location you would like to analyze
        • Example List of Locations to be Analyzed for one Subject

      • After a couple of seconds, the first image will appear
        • The program behaves differently depending on if the trial is anatomical or indentation
          • Anatomical - The program begins with the frame corresponding to the lowest resultant force
          • Indentation - The program begins with the frame that corresponds to the beginning of indentation
      • Drag the red dots so that the center of the dot is over each boundary (use the built in matplotlib toolbar to zoom in if needed)
        • Transducer/Skin boundary
        • Skin/Fat boundary
        • Fat/Muscle boundary
        • Muscle/Bone boundary
      • When you are happy with your selection, press 'next image' and the results will be calculated and saved to an xml file.
        • Manual Thickness Analysis

      • The next frame for analysis will automatically appear
        • Anatomical trials will give you the image corresponding to the next lowest force, until all frames within the first pulse and last pulse range have been analyzed
        • Indentation trials will give you the next image in the sequence until reaching the maximum force
      • After analyzing the frames for that location, hit the 'Done' button and the list of images for that subject will re-appear and you can analyze a new location.
      • The xml file that was saved will be re-formatted using pretty print (only if you hit the 'Done' button)
      • A PNG folder within the Analysis folder will be created that has saved images of the first frame that was analyzed as well as a graph showing the force/thickness relationships

      • You may end the program at any time by clicking the 'X' button in the upper right hand corner.
        • All windows will be closed and the script will stop running

          Example graph showing the force/thickness relationships

  5. Data storage
    • The xml file will be named using the tdms filename with '_manThick'+ time stamp appended
      • Version of software used for analysis (TA_sfm.py)
      • File Info includes the time stamp at the beginning of analysis as well as the user name at the time of program execution
      • Subject shows the MULTIS ID name
      • Source shows the Filename of the data (tdms) file
    • A new 'Frame' child is appended for each frame that is analyzed
      • The Frame child includes the following information:
        • Value - Frame number
        • Time - Reference time from the ultrasound time vector data (in ms)
        • Forces - Forces in the x, y, and z directions (in N)
        • Moments - Moments in the x, y, and z directions (in Nm)
        • Thicknesses - Skin, Fat, and Muscle layers (in mm)
          • XML results output

Thickness Inclusion XML

Repeatability & Reproducibility

Bland Altman Plot Example

Automated Thickness Measurement Development

Initial results report (using 12 locations from MULTIS-001-1): Specifications/DataAnalysis/report1.pdf

MRI/CT Thickness Analysis

Thickness Analysis Software

Program follows the Ultrasound thickness analysis with several modifications.

  1. Complete the registration and transformations of ultrasound positions to desired imaging modality coordinate system (MRI or CT). See Specifications/DataAnalysis/Registration page for protocols.

  2. Necessary files for registration and thickness analysis
    1. Imaging folder (MRI or CT)
      • Ultrasound position xml in desired image coordinate system (MRI or CT)
      • CT or MRI image in NIFTI format
  3. Required Python scripts
    • TA_sfm_CT_zProbe.py

    • TA_sfm_MR_zProbe.py

    • slice_view.py

    • tdsmParserMultis.py

    • XMLparser.py

  4. This script will create 2D slices to represent the ultrasound field of view for CT and MRI

    1. Install the required libraries as needed
    2. Change the directory, subject name, modality, and segment at the bottom of the script
      • Directory (dir) = directory of all in vitro subjects

      • Subject (subj_path) = name of subject folder (i.e. CMULTIS002-2)
      • Imaging modality (modality) = either CT or MRI
      • Extremity segment (segment) = either 'UpperLeg', 'LowerLeg', 'UpperArm', or 'LowerArm'

    3. Run the script.
      • Will create .vtk images in a new folder within the subject root folder for each location (CT_Slices or MR_Slices)
  5. slice_view.png slice_view_arm.png

  6. Running the manual thickness measurement script. CT script and MRI script

    1. Install libraries as needed
    2. Change the directory to match where the Python scripts are located
    3. Change the filename in getFiles() to the position xml (i.e. CMULTIS002-2_UL_US_CT.xml) created in the registration/transformation step
    4. Run script
      • A list will appear in which will show all the positions for that segment
      • Double-click on the location you would like to analyze
      • Drag the red dots so that the center of the dot is over each boundary (use the built in matplotlib toolbar to zoom in if needed)
        • Transducer/Skin boundary
        • Skin/Fat boundary
        • Fat/Muscle boundary
        • Muscle/Bone boundary
      • When you are happy with your selection, press 'Done'. Continue until all locations have been analyzed.
  7. Data storage
    • The xml file will be named using the ultrasound tdms filename with '_manThick'+ time stamp appended
      • Version of software used for analysis (TA_sfm.py)
      • File Info includes the time stamp at the beginning of analysis as well as the user name at the time of program execution
      • Subject shows the MULTIS ID name
      • Source shows the Filename of the data (tdms) file
    • A new 'Frame' child is appended
      • The Frame child includes the following information:
        • Value - Image frame/slice number
        • Thicknesses - Skin, Fat, and Muscle layers (in mm)
        • USPosition - Ultrasound tip position where the thicknesses were analyzed at (coordinate system is recorded)

Preliminary Results/Questions

In Vivo Thickness Analysis

In Vitro Ultrasound/MRI Thickness Comparison

Trial 1

Trial 2

Specifications/DataAnalysis/ThicknessAnalysis (last edited 2017-04-17 18:16:14 by ricimorrill1)