Switch to unified view

a/README.md b/README.md
1
# Slicer-MusculoskeletalAnalysis
1
# Slicer-MusculoskeletalAnalysis
2
2
3
Musculoskeletal Analysis extension for 3D Slicer.
3
Musculoskeletal Analysis extension for 3D Slicer.
4
4
5
<p align="center">
5
6
  <img width="50%" src="Scripted/MusculoskeletalAnalysis/Resources/Icons/MusculoskeletalAnalysis.png" alt="MusculoskeletalAnalysis Logo"/>
6
7
</p>
8
9
## How to use
7
## How to use
10
1. Load a DICOM 3D image using the Add DICOM Data module.
8
1. Load a DICOM 3D image using the Add DICOM Data module.
11
2. Create a segment representing the area to analyze using the Segmentations and Segment Editor modules.
9
2. Create a segment representing the area to analyze using the Segmentations and Segment Editor modules.
12
* **Cortical**: Segment should contain the bone including pores, but exclude the medullary cavity.
10
* **Cortical**: Segment should contain the bone including pores, but exclude the medullary cavity.
13
* **Cancellous**: Segement should contain cancellous bone and the spacing between bone, but exclude the surrounding cortical bone.
11
* **Cancellous**: Segement should contain cancellous bone and the spacing between bone, but exclude the surrounding cortical bone.
14
* **Density**: Segment should contain whatever area you want measured.
12
* **Density**: Segment should contain whatever area you want measured.
15
* **Intervertebral**: This function uses two segments, as thresholding alone may not be as effective at cleanly seperating NP from AF. One segment should contain the entire disc, the second should contrain just the Nucleus Pulposus. Order does not matter, as the analysys will identify which is which based on size.
13
* **Intervertebral**: This function uses two segments, as thresholding alone may not be as effective at cleanly seperating NP from AF. One segment should contain the entire disc, the second should contrain just the Nucleus Pulposus. Order does not matter, as the analysys will identify which is which based on size.
16
3. Select which type of analysis you wish to perform.
14
3. Select which type of analysis you wish to perform.
17
4. Use the Threshold Selector to select the values for bone. Used to seperate bone from pores in cortical analysis and spacing in cancellous analysis. Skip this step for intervertebral disc analysis.
15
4. Use the Threshold Selector to select the values for bone. Used to seperate bone from pores in cortical analysis and spacing in cancellous analysis. Skip this step for intervertebral disc analysis.
18
5. (Optional) Use the Advanced tab if the volume is not loaded from a DICOM.
16
5. (Optional) Use the Advanced tab if the volume is not loaded from a DICOM.
19
6. Use the Output Directory Selector to select a directory. Output files will be created in this directory if they do not already exist, or will be appended to if they do.
17
6. Use the Output Directory Selector to select a directory. Output files will be created in this directory if they do not already exist, or will be appended to if they do.
20
18
21
## Musculoskeletal Analysis
19
## Musculoskeletal Analysis
22
20
23
### IO: Input/output parameters
21
### IO: Input/output parameters
24
22
25
* **Input Volume**: A 3d image of the bone.
23
* **Input Volume**: A 3d image of the bone.
26
* **Analysis Segment**: A segment of the image containing the bone area to analyse.
24
* **Analysis Segment**: A segment of the image containing the bone area to analyse.
27
* **Threshold**: Threshold values representing bone.
25
* **Threshold**: Threshold values representing bone.
28
* **Analysis**: Select the analysis to perform.
26
* **Analysis**: Select the analysis to perform.
29
* **Output Directory**: The location to save the output file to.
27
* **Output Directory**: The location to save the output file to.
30
28
31
### Advanced tab
29
### Advanced tab
32
30
33
The program requires information from certain DICOM tags to run. Normally it can retrieve that information from the volume node, but if the volume node does not have those tags(i.e, if you are using a copy of the original volume, or your data came from a different format), you can either select a node that does, or enter the values manually.
31
The program requires information from certain DICOM tags to run. Normally it can retrieve that information from the volume node, but if the volume node does not have those tags(i.e, if you are using a copy of the original volume, or your data came from a different format), you can either select a node that does, or enter the values manually.
34
32
35
## Cortical Analysis
33
## Cortical Analysis
36
34
37
### IO: Input/output parameters
35
### IO: Input/output parameters
38
36
39
* **Input Volume**: A 3d image of the bone.
37
* **Input Volume**: A 3d image of the bone.
40
* **Bone Segment**: A segment of the image containing the cortical bone area. Includes pores, excludes the medullary cavity.
38
* **Bone Segment**: A segment of the image containing the cortical bone area. Includes pores, excludes the medullary cavity.
41
* **Threshold**: Threshold values representing bone. Used to seperate bone from pores.
39
* **Threshold**: Threshold values representing bone. Used to seperate bone from pores.
42
* **Output Directory**: The location to save the output file to.
40
* **Output Directory**: The location to save the output file to.
43
41
44
### Output File
42
### Output File
45
43
46
The output file is a `tsv` file named `cortical.txt` with the following columns:
44
The output file is a `tsv` file named `cortical.txt` with the following columns:
47
45
48
* **Date Analysis Performed**: The current date
46
* **Date Analysis Performed**: The current date
49
* **Input Volume**: Name of the input volume
47
* **Input Volume**: Name of the input volume
50
* **Mean Cortical Thickness (mm)**: The mean thickness of the bone, measured by largest sphere thickness, in milimeters
48
* **Mean Cortical Thickness (mm)**: The mean thickness of the bone, measured by largest sphere thickness, in milimeters
51
* **Cortical Thickness Standard Deviation (mm)**: The standard deviation of the above measurement
49
* **Cortical Thickness Standard Deviation (mm)**: The standard deviation of the above measurement
52
* **Tissue Mineral Density(mgHA/cm^3)**: The mean density of the bone, measured in miligrams of hydroxyapatite per cubic centimeter
50
* **Tissue Mineral Density(mgHA/cm^3)**: The mean density of the bone, measured in miligrams of hydroxyapatite per cubic centimeter
53
* **Porosity**: The fraction of the bone area made up of pores
51
* **Porosity**: The fraction of the bone area made up of pores
54
* **Total Area (mm^2)**: The area of the bone and medullary cavity. All areas are measured in average square milimeters per slice
52
* **Total Area (mm^2)**: The area of the bone and medullary cavity. All areas are measured in average square milimeters per slice
55
* **Bone Area (mm^2)**: The area of the bone
53
* **Bone Area (mm^2)**: The area of the bone
56
* **Medullary Area (mm^2)**: The area of the medullary cavity
54
* **Medullary Area (mm^2)**: The area of the medullary cavity
57
* **Polar Moment of Interia(mm^4)**: The moment of intertia around the z-axis, based on the shape of the mask. Measured in mm^4
55
* **Polar Moment of Interia(mm^4)**: The moment of intertia around the z-axis, based on the shape of the mask. Measured in mm^4
58
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
56
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
59
57
60
## Cancellous Analysis
58
## Cancellous Analysis
61
59
62
### IO: Input/output parameters
60
### IO: Input/output parameters
63
61
64
* **Input Volume:** A 3d image of the bone.
62
* **Input Volume:** A 3d image of the bone.
65
* **Bone Segment:** A segment of the image containing the cancellous bone area. Includes the medullary cavity, excludes surrounding cotical bone.
63
* **Bone Segment:** A segment of the image containing the cancellous bone area. Includes the medullary cavity, excludes surrounding cotical bone.
66
* **Threshold:** Threshold values representing bone. Used to seperate bone from cavity.
64
* **Threshold:** Threshold values representing bone. Used to seperate bone from cavity.
67
* **Output Directory:** The location to save the output file to.
65
* **Output Directory:** The location to save the output file to.
68
66
69
67
70
### Output File
68
### Output File
71
69
72
The output file is a `tsv` file named `cancellous.txt` with the following columns:
70
The output file is a `tsv` file named `cancellous.txt` with the following columns:
73
71
74
* **Date Analysis Performed**: The current date
72
* **Date Analysis Performed**: The current date
75
* **Input Volume**: Name of the input volume
73
* **Input Volume**: Name of the input volume
76
* **Total Volume (mm^3)**: The volume of the segmented area
74
* **Total Volume (mm^3)**: The volume of the segmented area
77
* **Bone Volume (mm^3)**: The volume of cancellous bone in the segmented area, calculated using marching cubes
75
* **Bone Volume (mm^3)**: The volume of cancellous bone in the segmented area, calculated using marching cubes
78
* **Bone Volume/Total Volume**: The fraction of the volume that is bone
76
* **Bone Volume/Total Volume**: The fraction of the volume that is bone
79
* **Mean Trabecular Thickness (mm)**: The mean thickess of the bone, measured using largest sphere thickness, in milimeters
77
* **Mean Trabecular Thickness (mm)**: The mean thickess of the bone, measured using largest sphere thickness, in milimeters
80
* **Trabecular Thickness Standard Deviation (mm)**: The standard deviation of the mean trabecular thickness
78
* **Trabecular Thickness Standard Deviation (mm)**: The standard deviation of the mean trabecular thickness
81
* **Mean Trabecular Spacing (mm)**: The mean thickness of the non area not containing bone in milimeters, measured using the same method as bone thickness.
79
* **Mean Trabecular Spacing (mm)**: The mean thickness of the non area not containing bone in milimeters, measured using the same method as bone thickness.
82
* **Trabecular Spacing Standard Deviation (mm)**: The standard deviation of the mean trabecular spacing
80
* **Trabecular Spacing Standard Deviation (mm)**: The standard deviation of the mean trabecular spacing
83
* **Trabecular Number**: Approximated as inverse of trabecular spacing
81
* **Trabecular Number**: Approximated as inverse of trabecular spacing
84
* **Structure Model Index**: A measurement of the trabecular shape. 0 is a plate, 3 is a rod, 4 is a sphere
82
* **Structure Model Index**: A measurement of the trabecular shape. 0 is a plate, 3 is a rod, 4 is a sphere
85
* **Connectivity Density**: A measurement of the number of connections per volume, based on the Euler characteristic of the bone after removing isolated components and holes
83
* **Connectivity Density**: A measurement of the number of connections per volume, based on the Euler characteristic of the bone after removing isolated components and holes
86
* **Tissue Mineral Density(mgHA/cm^3)**: The mean density of the bone, measured in miligrams of hydroxyapatite per cubic centimeter
84
* **Tissue Mineral Density(mgHA/cm^3)**: The mean density of the bone, measured in miligrams of hydroxyapatite per cubic centimeter
87
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
85
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
88
* **Lower Threshold**: The lower threshold value for bone
86
* **Lower Threshold**: The lower threshold value for bone
89
* **Upper Threshold**: The upper threshold value for bone
87
* **Upper Threshold**: The upper threshold value for bone
90
88
91
## Density Analysis
89
## Density Analysis
92
90
93
### IO: Input/output parameters
91
### IO: Input/output parameters
94
92
95
* **Input Volume**: A 3d image of the bone.
93
* **Input Volume**: A 3d image of the bone.
96
* **Bone Segment**: A segmentation of the image containing the bone area to be measured.
94
* **Bone Segment**: A segmentation of the image containing the bone area to be measured.
97
* **Output Directory**: The location to save the output file to.
95
* **Output Directory**: The location to save the output file to.
98
96
99
### Output File
97
### Output File
100
98
101
The output file is a `tsv` file named `density.txt` with the following columns:.
99
The output file is a `tsv` file named `density.txt` with the following columns:.
102
100
103
* **Date Analysis Performed**: The current date
101
* **Date Analysis Performed**: The current date
104
* **Input Volume**: Name of the input volume
102
* **Input Volume**: Name of the input volume
105
* **Area by Slice**: The area of the segment in each slice of each slice
103
* **Area by Slice**: The area of the segment in each slice of each slice
106
* **Mean Density by Slice**: The average density of the segmented area each slice
104
* **Mean Density by Slice**: The average density of the segmented area each slice
107
* **Standard Deviation of Density by Slice**: The standard deviation of the density of each slice
105
* **Standard Deviation of Density by Slice**: The standard deviation of the density of each slice
108
* **Min Density by Slice**: The lowest density in the segment of each slice
106
* **Min Density by Slice**: The lowest density in the segment of each slice
109
* **Max Density by Slice**: The highest density in the segment of each slice
107
* **Max Density by Slice**: The highest density in the segment of each slice
110
* **Mean Area**: The mean area of the segment of all slices
108
* **Mean Area**: The mean area of the segment of all slices
111
* **Standard Deviation of Area**: The standard deviation of the segmented area of all slices
109
* **Standard Deviation of Area**: The standard deviation of the segmented area of all slices
112
* **Min Area**: The area of the smallest segment slice
110
* **Min Area**: The area of the smallest segment slice
113
* **Max Area**: The area of the largest segment slice
111
* **Max Area**: The area of the largest segment slice
114
* **Mean Density**: The average density of the entire segmented volume
112
* **Mean Density**: The average density of the entire segmented volume
115
* **Standard Deviation of Density**: The standard deviation of density of the segmented volume
113
* **Standard Deviation of Density**: The standard deviation of density of the segmented volume
116
* **Min Density**: The minimum density of the segmented volume
114
* **Min Density**: The minimum density of the segmented volume
117
* **Max Density**: The maximum density of the segmented volume
115
* **Max Density**: The maximum density of the segmented volume
118
116
119
## Intervertebral Analysis
117
## Intervertebral Analysis
120
118
121
### IO: Input/output parameters
119
### IO: Input/output parameters
122
120
123
* **Input Volume**: A 3d image of an intervertebral disc
121
* **Input Volume**: A 3d image of an intervertebral disc
124
* **Segement1** and **Segment2**: Two segmentations containing the disc and the nucleus pulposus. (Differentiated by size)
122
* **Segement1** and **Segment2**: Two segmentations containing the disc and the nucleus pulposus. (Differentiated by size)
125
* **Output Directory**: The location to save the output file to.
123
* **Output Directory**: The location to save the output file to.
126
124
127
### Output File
125
### Output File
128
126
129
The output file is a `tsv` file named `intervertebral.txt` with the following columns:
127
The output file is a `tsv` file named `intervertebral.txt` with the following columns:
130
128
131
* **Date Analysis Performed**: The current date
129
* **Date Analysis Performed**: The current date
132
* **Input Volume**: Name of the input volume
130
* **Input Volume**: Name of the input volume
133
* **Disc Volume (mm^3)**: The volume of the disc
131
* **Disc Volume (mm^3)**: The volume of the disc
134
* **Nucleus Pulposus Volume (mm^3)**: The volume of the NP
132
* **Nucleus Pulposus Volume (mm^3)**: The volume of the NP
135
* **Volume Ratio**: The ratio of whole disc volume to NP volume
133
* **Volume Ratio**: The ratio of whole disc volume to NP volume
136
* **Annulus Fibrosus Width (mm)**: The width of the AF, calculated by using rotating calipers algorithm on each slice and finding the maximum width
134
* **Annulus Fibrosus Width (mm)**: The width of the AF, calculated by using rotating calipers algorithm on each slice and finding the maximum width
137
* **Nucleus Pulposus Width (mm)**: The width of the NP, calculated using the same method as AF width
135
* **Nucleus Pulposus Width (mm)**: The width of the NP, calculated using the same method as AF width
138
* **Disc Height (mm)**: The height of the disc at its center
136
* **Disc Height (mm)**: The height of the disc at its center
139
* **Disc Height Ratio**: The ratio of disc height to disc width
137
* **Disc Height Ratio**: The ratio of disc height to disc width
140
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
138
* **Voxel Dimension (mm)**: The side length of one voxel, measured in milimeters
141
139
142
## Tutorials:
140
## Tutorials:
143
141
144
### Cortical Analysis:
142
### Cortical Analysis:
145
1. Load Cortical1 and CorticalMask1 from the Sample Data Module.
143
1. Load Cortical1 and CorticalMask1 from the Sample Data Module.
146
2. Open the Musculoskeletal Analysis Module under Quantification.
144
2. Open the Musculoskeletal Analysis Module under Quantification.
147
3. Set Analysis to "Cortical Bone".
145
3. Set Analysis to "Cortical Bone".
148
4. Set Input Volume to Cortical1.
146
4. Set Input Volume to Cortical1.
149
5. Set Analysis Segment to CorticalMask1 and Segment_1.
147
5. Set Analysis Segment to CorticalMask1 and Segment_1.
150
6. Use the sliders to set Threshold to 4000-10000.
148
6. Use the sliders to set Threshold to 4000-10000.
151
7. Open the Advanced tab and click "Enter DICOM tags manually".
149
7. Open the Advanced tab and click "Enter DICOM tags manually".
152
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
150
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
153
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
151
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
154
10. Click "Apply".
152
10. Click "Apply".
155
153
156
### Cancellous Analysis
154
### Cancellous Analysis
157
1. Load Cancellous1 and CancellousMask1 from the Sample Data Module.
155
1. Load Cancellous1 and CancellousMask1 from the Sample Data Module.
158
2. Open the Musculoskeletal Analysis Module under Quantification.
156
2. Open the Musculoskeletal Analysis Module under Quantification.
159
3. Set Analysis to "Cancellous Bone".
157
3. Set Analysis to "Cancellous Bone".
160
4. Set Input Volume to Cancellous1.
158
4. Set Input Volume to Cancellous1.
161
5. Set Analysis Segment to CancellousMask1 and Segment_1.
159
5. Set Analysis Segment to CancellousMask1 and Segment_1.
162
6. Use the sliders to set Threshold to 1500-10000.
160
6. Use the sliders to set Threshold to 1500-10000.
163
7. Open the Advanced tab and click "Enter DICOM tags manually".
161
7. Open the Advanced tab and click "Enter DICOM tags manually".
164
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
162
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
165
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
163
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
166
10. Click "Apply".
164
10. Click "Apply".
167
165
168
### Density Analysis
166
### Density Analysis
169
1. Load Cancellous1 and CancellousMask1 from the Sample Data Module.
167
1. Load Cancellous1 and CancellousMask1 from the Sample Data Module.
170
2. Open the Musculoskeletal Analysis Module under Quantification.
168
2. Open the Musculoskeletal Analysis Module under Quantification.
171
3. Set Analysis to "Bone Density".
169
3. Set Analysis to "Bone Density".
172
4. Set Input Volume to Cancellous1.
170
4. Set Input Volume to Cancellous1.
173
5. Set Analysis Segment to CancellousMask1 and Segment_1.
171
5. Set Analysis Segment to CancellousMask1 and Segment_1.
174
6. Use the sliders to set Threshold to 1500-10000.
172
6. Use the sliders to set Threshold to 1500-10000.
175
7. Open the Advanced tab and click "Enter DICOM tags manually".
173
7. Open the Advanced tab and click "Enter DICOM tags manually".
176
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
174
8. Set values to 0.0073996, 4096, 365.712, -199.725998, and 0.4939.
177
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
175
9. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
178
10. Click "Apply".
176
10. Click "Apply".
179
177
180
### Intervertebral Analysis
178
### Intervertebral Analysis
181
1. Load Intervertebral1 and IntervertebralMask1 from the Sample Data Module.
179
1. Load Intervertebral1 and IntervertebralMask1 from the Sample Data Module.
182
2. Open the Musculoskeletal Analysis Module under Quantification.
180
2. Open the Musculoskeletal Analysis Module under Quantification.
183
3. Set Analysis to "Intervertebral Disc".
181
3. Set Analysis to "Intervertebral Disc".
184
4. Set Input Volume to Intervertebral1.
182
4. Set Input Volume to Intervertebral1.
185
5. Set Analysis Segment to IntervertebralMask1 and check Segment_1 and Segment_2.
183
5. Set Analysis Segment to IntervertebralMask1 and check Segment_1 and Segment_2.
186
6. Open the Advanced tab and click "Enter DICOM tags manually".
184
6. Open the Advanced tab and click "Enter DICOM tags manually".
187
7. Set "Voxel Size" to 0.01, leave the other fields blank.
185
7. Set "Voxel Size" to 0.01, leave the other fields blank.
188
8. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
186
8. Click the "..." next to Output Directory to open the directory selection menu, and select a location to save files to.
189
9. Click "Apply".
187
9. Click "Apply".
190
188
191
## Python Dependencies
189
## Python Dependencies
192
190
193
The following additional python packages are required and will be installed the corresponding analysis functions are run:
191
The following additional python packages are required and will be installed the corresponding analysis functions are run:
194
192
195
|                | Cortical Analysis  | Cancellous Analysis | Density Analysis   | Intervertebral Analysis |
193
|                | Cortical Analysis  | Cancellous Analysis | Density Analysis   | Intervertebral Analysis |
196
|----------------|--------------------|---------------------|--------------------|-------------------------|
194
|----------------|--------------------|---------------------|--------------------|-------------------------|
197
| `pynrrd`       | :white_check_mark: | :white_check_mark:  | :white_check_mark: | :white_check_mark:      |
195
| `pynrrd`       | :white_check_mark: | :white_check_mark:  | :white_check_mark: | :white_check_mark:      |
198
| `scikit-image` | :white_check_mark: | :white_check_mark:  |                    |                         |
196
| `scikit-image` | :white_check_mark: | :white_check_mark:  |                    |                         |
199
| `scipy`        | :white_check_mark: | :white_check_mark:  |                    |                         |
197
| `scipy`        | :white_check_mark: | :white_check_mark:  |                    |                         |
200
| `trimesh`      |                    | :white_check_mark:  |                    |                         |
198
| `trimesh`      |                    | :white_check_mark:  |                    |                         |
201
199
202
## Screenshots
200
203
204
| ![Musculoskeletal Analysis](Scripted/MusculoskeletalAnalysis/Resources/Icons/Screenshot.png) |
205
|--|
206
| <sub>_User interface of the Musculoskeletal Analysis module._</sub> |
207
208
## License
201
## License
209
202
210
This software is licensed under the terms of the [MIT](LICENSE.txt).
203
This software is licensed under the terms of the [MIT](LICENSE.txt).
211
204