-
Notifications
You must be signed in to change notification settings - Fork 0
/
additional-tools.Rmd
executable file
·124 lines (81 loc) · 7.31 KB
/
additional-tools.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
title: "Additional tools"
date: "Last updated: `r format(Sys.time(), '%B %d, %Y')`"
output:
html_document:
toc: TRUE
toc_depth: 3
toc_float:
collapsed: FALSE
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, child = "js/back-to-top.js"}
```
<br>
In addition to the five core modules, Gannet comes with a few additional tools that you may find useful.
## PaperPlot
`PaperPlot.m` will plot the difference spectra saved in the Gannet output structure. The corresponding model fits optionally can also be plotted. Users can choose to plot a single spectrum, a select number of spectra, all spectra, or an average of all spectra with or without the standard deviation. Multiple spectra will be overlaid in the same figure. If data were acquired with HERMES, then each Hadamard-combined difference spectrum will be plotted in a separate subplot.
Type `help PaperPlot` in the MATLAB command window for usage instructions.
To export plots at publication quality, consider using `PaperPlot.m` with Yair Altman's excellent <a href="https://github.com/altmany/export_fig/" target="_blank">export_fig</a> MATLAB toolbox. This toolbox is bundled with Gannet.
### Example usage
```{octave, eval = FALSE}
metab = {'S01_GABA_68_act.sdat'
'S02_GABA_68_act.sdat'
'S03_GABA_68_act.sdat'};
water = {'S01_GABA_68_ref.sdat'
'S02_GABA_68_ref.sdat'
'S03_GABA_68_ref.sdat'};
MRS = GannetLoad(metab, water);
MRS = GannetFit(MRS);
PaperPlot(MRS); % Use default settings
```
<img id="img_75" src="images/additional-tools/paperplot-1.png" alt="Example output of PaperPlot.m">
```{octave, eval = FALSE}
PaperPlot(MRS, 'plotModel', true); % Overlay fit models
```
<img id="img_75" src="images/additional-tools/paperplot-2.png" alt="Example output of PaperPlot.m">
```{octave, eval = FALSE}
PaperPlot(MRS, 'plotModel', true, 'freqLim', [2 4.25]); % Overlay fit models and
% set ppm limits to 2-4.25
```
<img id="img_75" src="images/additional-tools/paperplot-3.png" alt="Example output of PaperPlot.m">
## De-identification
MRI examinations involving human volunteers routinely store sensitive protected health information (PHI) and personally identifiable information (PII) in the exported data files. It is of vital importance to protect volunteers’ privacy. To comply with privacy legislation, you need to ensure that the data you handle, process, and share is appropriately and thoroughly de-identified, i.e., stripped of all PHI/PII that allows the data to be linked to an individual. This is particularly critical if you intend to share data outside your institution.
Gannet includes several functions to remove PHI/PII from the most commonly used file formats. Currently, we offer functions to remove PHI/PII from GE P-files (\*.7), Siemens TWIX (\*.dat), Philips (\*.sdat/\*.spar), and generic DICOM (\*.dcm) files. We plan to add support for other formats in the future.
Please <a href="mailto:[email protected]?subject=[Gannet]%20<Please enter the subject of your query here>" target="_blank">contact us</a> if you require a de-identification tool for a different format.
Please note the following:
::: warning
<i class="fa fa-exclamation-circle" style="color: white"></i>
<ul>
<li>Gannet does not remove PHI/PII from filenames; this is solely your responsibility.</li>
<li>In addition to any PHI/PII in the header of structural image files, they need to be defaced as well. Please use a skull-stripping tool (such as the one implemented in FSL) or a defacing tool (e.g., <a href="https://github.com/poldracklab/pydeface" target="_blank" style="color:white"><u>pydeface</u></a>).</li>
<li>Per our <a href="https://markmikkelsen.github.io/Gannet-docs/gannet-license.html" target="_blank" style="color:white"><u>software license</u></a>, the Gannet developers are not liable for any failure of our de-identification routines to remove PHI/PII from your data.</li>
</ul>
:::
### How to de-identify your files
The Gannet de-identification functions create de-identified copies of the original data. The original files are not overwritten.
<u>GE P-files, Siemens TWIX, and Philips SDAT</u>
For GE P-files (\*.7), Siemens TWIX (\*.dat), and Philips (\*.sdat/\*.spar) files, the Gannet functions `GEDeIdentify.m`, `TWIXDeIdentify.m`, and `PhilipsDeIdentify.m` create de-identified copies of the respective files, appended with `_noID`. All three functions can either be run by themselves (without any input arguments) to de-identify all relevant files within the current directory or given a cell array of filenames that you want to de-identify.
<u>DICOM</u>
Generic DICOM data usually feature many separate \*.dcm files for each acquisition. `DICOMDeIdentify.m` requires a top-level directory containing subdirectories for each subject (e.g. `S01/`, `S02/`, `S03/`, etc.) that contain all DICOM files for the respective subjects. Running `DICOMDeIdentify.m` from the top-level directory will create a separate directory containing the de-identified files for each subject, appended with `_anon`.
### List of PHI identifiers
The Gannet de-identification functions currently remove PHI/PII identifiers defined by the <a href="https://www.hhs.gov/hipaa/for-professionals/privacy/special-topics/de-identification/index.html" target="_blank">United States Health Insurance Portability and Accountability Act (HIPAA) Privacy Rule</a>. These include, but are not limited to:
- Names
- Addresses
- Dates, including birth date and examination date
- Medical record numbers
- Device identifiers and serial numbers
Should the regulations in your country or institution require additional information to be removed, please <a href="mailto:[email protected]?subject=[Gannet]%20<Please enter the subject of your query here>" target="_blank">contact us</a>.
::: danger
<i class="fa fa-exclamation-triangle" style="color: white"></i> There is <u>no way</u> to retrieve PHI/PII from a de-identified file! Make sure that you either retain a copy of the original file or that you keep a separate record that uniquely links all necessary subject information to the de-identified file.
:::
## CoRegStandAlone
Gannet has a standalone routine for voxel co-registration and segmentation that can be utilized with any single-voxel MRS dataset, including non-edited data. `CoRegStandAlone.m` contains simplified versions of `GannetLoad.m`, `GannetCoRegister.m`, and `GannetSegment.m` to parse geometrical information about voxel dimensions, positions, and rotations.
`CoRegStandAlone.m` supports the same input formats as the main Gannet modules. Upon being called, it produces GannetCoRegister and GannetSegment outputs for each provided dataset. However, the GannetSegment output does not contain any quantitative information, except for tissue composition (voxel tissue fractions of GM, WM, and CSF).
The syntax is similar to `GannetLoad.m` syntax, where the first cell array contains the MRS filenames and the second cell array contains the respective NIfTI filenames:
```{octave, eval = FALSE}
MRS_struct = CoRegStandAlone({'data1.dat', 'data2.dat'}, {'structural1.nii', 'structural2.nii'});
```
Please note that the number of NIfTI files needs to match the number of MRS data files; i.e., if you want to register _N_ voxels to the same structural image, you’ll need to replicate the name of the NIfTI file _N_ times.