Size: 8132
Comment:
|
Size: 8647
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 88: | Line 88: |
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 '''TimeSynchronization.txt''' file is located within the subject folder. | 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 are located in the '''TimeSynchronization''' folder. |
Line 90: | Line 90: |
* '''MULTIS###-#''' (Subject folder containing all data - the required data for the thickness measurements are shown below) * '''Data''' * '''Ultrasound''' * '''TimeSynchronization.txt''' |
* '''MULTIS###-#''' (Subject folder containing all data - the required data for the thickness measurements is shown below) * '''Data''' - Contains tdms files * '''Ultrasound''' - Contains dicom files * '''TimeSynchronization''' - Contains xml files with deltaT values for matched trials |
Line 95: | Line 95: |
* '''ThicknessAnalysis_simple.py''' | * '''ThicknessAnalysis_simple_indivDT.py''' |
Line 97: | Line 97: |
* '''XMLparser.py''' * '''Plot_thicknessForce.py''' |
|
Line 103: | Line 105: |
* A list will appear in another window which will show all the accepted trial locations for that subject (you may have to scroll down to see the entire list) | * 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) |
Line 108: | Line 110: |
* Anatomical - The program begins with the frame corresponding to the lowest normal force | * Anatomical - The program begins with the frame corresponding to the lowest resultant force |
Line 116: | Line 118: |
{{attachment:TA_example.png|Manual Thickness Analysis|height=500}} | |
Line 119: | Line 122: |
* You may end the program at any time by clicking the 'Close Program' button | * You may end the program at any time by clicking the 'Save and Quit' button |
Line 121: | Line 124: |
* 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 | |
Line 122: | Line 126: |
{{attachment:TA_example.png|Manual Thickness Analysis|height=500}} | {{attachment:TA_graphs.png|Example graph showing the force/thickness relationships|height=500}} |
Line 125: | Line 129: |
* A new 'Location' child is appended for each frame that is analyzed * The Location child includes the following information: * Name - Location name with frame number |
* Subject shows the 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 |
Line 131: | Line 137: |
{{attachment:TA_xmlexample.png|XML results output|height=300}} | {{attachment:TA_xmlExample.png|XML results output|height=300}} |
Contents
Target Outcome
Prerequisites
Protocols
File Association
- Setting up the Directory
- Download and unpack the subject folder and place in MULTIS_trials folder
- The folder/file configuration should be the following
MULTIS_trials
MULTIS###-# (Subject folder containing all data)
Configuration - Configuration files and subject XML
Data - All "tdms" files
Ultrasound - All "dicom" files
PulseWidths300.csv - contains key to decode file association pulse
manualMatcherFA.py
plotterFA.py
XMLparser.py
dataAnalysis.py
tdsmParserMultis.py
- Running the File Association script
- Install libraries as needed
- Change Directory to match desired Subject ID
- Ensure Plot is True to save all verification plots
- Run script.
- Check directory in file browser under the subject folder for the following additions
- FileAssociationPNG - folder
TimeSynchronization.txt - file containing trial numbers and delta T's of accepted trials only
- MULTIS###-#readme.txt - human readable file which summarizes the file matching
- Manually Matching
- Open the 'MULTIS###-#readme.txt' file
- Note the Unmatched and Accepted Trials, specifically the binary column
- Examine any files beginning with 'NMa', meaning no match found
- Locate the start and end pluses, each a burst of two peaks.
- Compare the binary of the trial run number to each of the pulse sequences found in the 'NMa' png's. Note the file names of each. At this point, it is known which file each of the missing accepted trial numbers belong to.
Open the manualMatcherFA.py and plotterFA.py python scripts.
Change the directory file names in the manualMatcherFA script to a pair of matching files found in step 2. Only one pair of files will be compared at a time. The files will be imported to the plotterFA script automatically.
- Run the plotterFA.py script, ensuring iteration is set to zero.
- Examine the figure generated.
- The pulse extracted from the dicom (bottom of figure) should match the pulse from the tdms file (top of figure). Note the dicom pulse will not always begin at the left most portion of the window as it is a continuous loop in the ultrasound machine.
- As before, locate the beginning and ending double pulses.
- Count the number of peaks present in the dicom pulse.
- Count the number of RWaves in the generated figure.
- It is likely that one or more of the RWaves are missing, as that is why the files did not match.
- Change the iteration from 0, to 1, to 2, and so on and re-plot each time until the RWaves appear to line up with the pulse peaks in the top figure.
- Identify which peaks have RWaves, and which do not.
- Each of the peaks in the upper figure has a number associated with it in the script. Starting from 0, instead of 1, the peaks are named accordingly.
- Record which peaks have RWaves. For example. (1,2,5,6) may have RWaves.
- Open the 'MULTIS###-#readme.txt' file
9 . Return to manualMatcherFA.py
- Ensure iteration is set to 2.
- Change the chosenRwaves variable to reflect the the recorded RWaves i.e. (1,2,5,6)
- Run the script
- Check the following items
- The filename of the dicom and tdms changed appropriately
- The trial number and time synch were added to
MULTIS###-#readme.txt
The updated PNG was added to the FileAssociationPNG folder
Quality Assurance
- Setting up the Directory
- same as file association with the addition of folders created by file association
- Running the dataAnalysis.py script
- Change Directory to reflect subject ID
- Run script
- Check the following
A folder named AnalysisPNG should appear under MULTIS###-#
- 56 png files should be found within this folder
- Analysis
- There are two types of figures
- Anatomical
- 3 dicom images (at 1st pulse, minimum force, last pulse) over load cell data
- Indentation
- 4 dicom images (at pre, start, middle, max indentation) over load cell data
- Anatomical
- There are two types of figures
Thickness Measurements
- Setting up the Directory
- 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 are located in the TimeSynchronization folder.
- 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.
- The folder/file configuration should be the following
MULTIS###-# (Subject folder containing all data - the required data for the thickness measurements is shown below)
Data - Contains tdms files
Ultrasound - Contains dicom files
TimeSynchronization - Contains xml files with deltaT values for matched trials
- Required Python scripts
ThicknessAnalysis_simple_indivDT.py
tdsmParserMultis.py
XMLparser.py
Plot_thicknessForce.py
- Running the manual thickness measurement script
- Install libraries as needed
- Change the directory to match where the Python scripts are located
- 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
- 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)
- 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
- The program behaves differently depending on if the trial is anatomical or indentation
- Drag the red dots so that the center of the dot is over each boundary
- Superficial skin
- Skin/Fat boundary
- Fat/Muscle boundary
- Muscle/Bone boundary
- When you are happy with your selection, press 'enter' on your keyboard and the results will be calculated and saved to an xml file
- To analyze the next image, hit the 'Next Image' button
- 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
- You may end the program at any time by clicking the 'Save and Quit' button
- The xml file that was saved will be re-formatted using pretty print
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
- All windows will be closed and the script will stop running
- Data storage
- The xml file will be named using the tdms filename with all of the descriptors for the trial
- Subject shows the 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
- 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)
- The Frame child includes the following information:
- The xml file will be named using the tdms filename with all of the descriptors for the trial