Académique Documents
Professionnel Documents
Culture Documents
Right click in the Middle View of the fitMAN window in order to activate that view
File, Data
a window opens, called "Please select a file for reading"
In the Directory box, the path should be:
/home/denise/fitMAN_v1.0/fitMAN_Documentation
(Note: if default directory is wrong: click on Options in the fitMAN Suite window,
and set default directory to: /home/denise/fitMAN/fitMAN_Documentation / OK)
In Directories, navigate into the folder where the P .7 file is located
In Files, double click on the _s.dat file created in step 1.1
The file will appear in the middle view, in the Time domain
Domain
Frequency
While the spectrum is in the Frequency domain, record how large is the
bandwidth. We need this information to calculate the dwell time, which is 1 over
the bandwidth.
For example, if the spectrum bandwidth is 2,500 Hz (cycles per sec), dwell time
will be 1/2,500 or .0004 seconds, or .4 milliseconds (ms).
Record this information.
Still in the Frequency domain, we need to evaluate whether a zero order phase
correction will be sufficient for all the peaks to be aligned. Use the cursor just
above Phase (Degrees) on the left side of the window to evaluate if the all peaks
can be aligned perfectly.
Record how many degrees are required for a good alignment.
If this phase adjustment produces adequate alignment, the Time Delay will be 0
when we will apply corrections in step 1.3.
If the Phase (Degrees) cursor does not get a good alignment of all the peaks, it
means that a 1st order phase correction is required. To visually evaluate in the
Frequency domain how many points at the beginning of the FID will need to be
cut off for all the peaks to be aligned, use FT 1 (s) and increase the value by
increments of dwell time, till all the peaks are perfectly well aligned in the middle
view of the fitMAN window.
If a change in FT 1 was required for the peaks to be aligned, record how many sec
were required. That information will be required for the Time Delay when
creating the _convert files.
Domain
Time
Looking at the spectrum in the Time domain, we first inspect the end of the FID.
If the tail is free of artifacts and shows only narrow, regular noise, it means that it
will be appropriate to apply a Baseline Correction during the conversion step that
will be performed in step 1.3.
3
In the Time domain, we also need to determine the Junction Point on the x-axis,
between the area that will undergo quality deconvolution (QUECC), and the area
for eddy current correction (ECC). We can zoom on the baseline for a better
assessment of where the signal has almost disappeared and almost only noise is
left. Choose this point conservative: make sure that there is a tiny bit of signal left
at the cut off point.
For example, if the junction point is evaluated to be .09 sec or 90 millisec,
junction time divided by dwell time will be: 90 ms / .4 ms = 225 Quality points.
Record this information; it is required in step 1.3.
We can also determine right away which part of the FID tail will not be necessary
to include in the fit. That point will likely be a little greater than the one
determined for the junction point because here, we want to make sure that all the
signal will be included in the fit, while still excluding this part of the tail that
obviously represents only noise.
For example, if the cut off point for the fit is determined to be .35 sec, 350ms / .4
ms = 875 data points to be included in the fit.
Record this information.
4
correction was necessary); Quality Points: enter the Junction Point (time in ms/dwell
time) calculated in step 1.2.
OK
This process has created two files, located in fitMAN_Documentation:
rescode_pfilenumber_convert_s.dat
rescode_pfilenumber_convert_uns.dat
e. g. : sdtC01a_p22016_convert_s.dat
At this point, we can open the header of the .dat files, in order to record information that will be
required for the .xls sheet in step 3.
In the Finder, highlight each .dat file, open with Text Editor (emacs is good), and record the
conversion scaling factor and the receiver gain for each of the _s.dat and _uns.dat file:
It can be useful to also record date and time of MRS acquisition, ROI position (P1, P2, & P3) and
volume (V1, V2, & V3).
To view the corrected spectrum:
Right click in the Middle View of the fitMAN window
File, Data, Select the _convert_s.dat file / OK
It will appear in the Middle View, in the Time domain
The _convert_uns.dat file will be used later in step 2.2.
1.4 Removal of the residual water peak, prior to generating the fit
Since fitting occurs in the Time domain, signal representing each spectral component is present
throughout the Time domain signal. Therefore, it is necessary to remove the residual water signal
before performing metabolite fitting with prior knowledge.
Already loaded: the file rescode_pfilenumber_convert_s.dat
Domain, Frequency
Arithmetic,
HSVD Water Removal
OK
Let it work. This will subtract the peaks within a limited range, surrounding the water resonance.
2. Fitting
Following water removal, the spectrum is now ready for fitting.
Fitting is accomplished incorporating prior knowledge of metabolite lineshapes.
6
When variables have been changed,
save .ges file and return to window Fitman Suite
zoom out, click File, and Reload .ges file.
Finally, we need to determine the range of the FID that will be used for the fit.
The cut off point at the tail of the FID has been determined in step 1.2.
The cut off point at the beginning of the FID still needs to be determined.
To make that decision, the FT1 (s) parameter can be changed by increments of dwell time, till there is
enough cleaning up of macromolecules and artifacts, but still enough signal to noise ratio left.
e.g. FT1 (s) could be changed to .0004sec, then .0008, .0016, .- till you are satisfied with the output
visualized in the Middle View. When the decision is made about how many sec should be cut off from
the beginning of the FID, calculate how many data points those seconds represent, and
Change the range in the 3peak.cst file. Save the file, and record the new parameters used for that fit.
e.g. For my data, FT1(s) is usually best at .0296 sec (or 29.6 ms or 74 data points).
However, we could try to go up to as much as .037 sec (37 ms).
For my data, FT2 (s) is usually around .3 sec (or 300 ms or 750 data points).
At this point, we can open the_waterfit.out file with a text editor, and record the following
information that will be required in the .xls sheet in step 3:
Width_L (Hz):
Amplitude:
Open the spreadsheet containing the information that was recorded from:
rescode_pfilenumber_convert_s.dat
rescode_pfilenumber_convert_uns.dat
rescode_pfilenumber_waterfit.out
Open the spreadsheet containing the fractional content of each tissue type in the ROIs.
Entering information
From the _convert_s.dat file and from the recorded information during fitting:
AQ:
AR:
AS:
AV:
AW:
AY:
AZ:
enter the name of the _s.dat file in the Suppressed Filename cell
enter the name of the _convert_s.dat file
enter QUECC points/delay used when creating the _convert files
Gain (e.g.: 145)
NT (or NEX)
Machine Scaling factor
Conversion Scaling factor
9
From the _waterfit.out file:
BH:
BI:
FWHM (Hz)
Amplitude or area
FW H2O = 18.0152 (the formula weight of water: the atomic weight of oxygen and two hydrogen atoms)
Density at 38C = 0.99299
H2O at 38C = BN / BM
Click
Run
Another window opens:
navigate into the folder with all the _fit.out files,
select the appropriate rescode_pfilenumber_fit.out file
Click Open.
10
RAW
sup_sum1.fid
(Rename)
=> id_full_sup128.fid
Metabolites + macro
RAW
sup_sum2.fid
(Rename)
=> id_macro_sup128.fid
Macromolecules
RAW
unsup_sum1.fid
(Rename)
=> id_water_unsup8.fid
Reference water file
RAW
Just for viewing prior to converting
(Run Convert)
=> id_full.dat (Disable baseline correction and reference)
id_full_sup128.fid + id_water_sup8.fid
(Run convert)
=> id_full_convert400_s.dat
=> id_full_convert400_uns.dat
id_macro_sup128.fid + id_water_unsup8.fid
(Run convert)
=> id_macro_convert400_s.dat
=> id_macro_convert400_uns.dat
2
Fitting the macromolecules:
id_macro_convert400_s.dat
(Run HSVD fit, 256 points, 20 peaks, scaling is 1)
=> id_macro_convert400_fit256.dat
Save active window
4
Removing the residual water peak:
id_full400_noMacro.dat
(Run HSVD water removal, xx points, 35 peaks)
=> id_full_HSVD400.dat
Save active window
6
Generate fit of water file:
id_full_convert400_uns.dat
Human_water.cst
Human_water.ges
(Generate fit)
=> id_VOI_waterfit850.out
Save a .jpg image of the fit
Save the .cst and .ges files
5
Generate fit of metabolites:
id_full_HSVD400.dat
Human_vivo.cst
Human_vivo.ges
(Generate fit)
=> id_VOI_fit850.out
Save a .jpg image of the fit
_convert_s.dat
_convert_uns.dat
_fit.out
_waterfit.out
11
Scanner output:
sup_sum1.fid
sup_sum2.fid
unsup_sum1.fid
unsup_sum2.fid
12
use baseline correction
reference file: id_water_unsup8.fid (unsup_sum1.fid)
use baseline correction; Delay at 0 and Quality points at 400
This process has created two files:
id_macro128_convert400_s.dat
id_macro128_convert400_uns.dat
Load
id_macro128_convert400_s.dat on the top panel and on the middle panel of the fitMAN Suite.
(Working in the Frequency domain)
Click into the middle window to activate it.
Arithmetic => HSVD fit
use 256 data points
disable SRSV Auto Detect: 35 Values (peaks) will appear in the SRSV box
set the SRSV box to 20 peaks (fewer peaks is better than more because
at one point it would start fitting the noise)
That step created a fitted macromolecules spectrum in the middle window.
Save that file:
Activate middle window
File => Save Active Window: id_macro128_convert400_fit256.dat
In order to see if the macromolecules fit is good:
Activate the middle window (the fitted macromolecules file)
Arithmetic => Subtract: Manual / no scale
(the Scaling factor is 1, as shown on the terminal window)
The bottom panel will show the residuals (acquired minus fitted),
which should only be regular noise.
Activate the top panel and set EF at 5 in order to visually evaluate the correspondence
of the macro peaks between the 2 top files.
13
3rd step: subtracting the fitted macromolecules from the full spectrum
Compare the Conversion scaling factors of these two files (open each file and look at ConvS):
id_full128_convert400_s.dat
id_macro128_convert400_fit256.dat
Differences in scale between the two files must be taken into account during the subtraction process.
For our test data:
The conversion scaling factor was 1.00e -04 for the id_full_convert400.dat file
and it was 1.00e -03 for the id_macro_convert400_fit256.dat file.
It's the macromolecules spectrum that is being re-scaled to the full spectrum or to put this another
way, the scaling factor is applied to the macromolecules file.
Load
id_full128_convert400_s.dat in the top panel
id_macro128_convert400_fit256.dat in the middle panel
Arithmetic => Subtract: Manual / no scale
Scaling factor is usually 1.2 at 4T (when both files have the same ConvS
factor) but for our test data here, it will be 0.12
The output of the subtraction will show in the bottom panel.
Save the output file:
File => Save Active Window: id_full128_noMacro.dat
14
15
16
7th step: entering the data into the .xls summary spreadsheet
The required files:
id_ROIname_fit.out
id_ROIname_waterfit.out
id_full_convert400_s.dat
id_full_convert400_uns.dat
fractional content of each tissue type within each spectroscopic volume of interest
fitMAN_data_summary.xls
PC_fitMAN_data_compile_macro.xls
See pages 8-9 for practical details on how to enter the data.
17
Appendix 1
How to calculate the S/N ratio with fitMAN
We load the id_full_wtrRem400.dat file with the goal of assessing the SNR before fitting the data. No
.ges or .cst file in the panel.
Work in the Frequency domain.
The SNR is defined as the maximum amplitude of the NAA peak (as an example peak) divided by the
SD of the noise in the frequency domain.
Don't use the noise filters (EF & GF); they must be set at zero.
1) Set Phase Degrees properly.
2) Adjust FT(1) according to the numbers of initial points that will not be included in the fit. Also
adjust FT(2) according to the end of the FID that will be used for the fit.
3) Visualize the spectrum. Units of the X axis are in Hz (units => Hz). The line of the noise should be
at 0 on the Yaxis. If that's not the case, ignore 1-3 initial data points using FT(1).
4) Statistics => Standard Deviation: a new window appears and shows the loaded spectrum along with
a list of parameters that can be used for calculations.
5) Zoom onto the NAA peak if that's the one you're interested to calculate. In the box Minimum
Frequency, enter the minimum value in Hz that includes the NAA peak region on the X axis. Into the
Maximum Frequency box, enter the maximum Hz value that covers the NAA peak region on the X
axis.
6) Press the Calculate button. Read and record the Max Real Value of the NAA amplitude.
7) Repeat these procedures (4 & 5) selecting a noise region aside the metabolite region.
Press the Calculate button. Read and record STD Dev Real, which is the SD of the noise.
8) Using a calculator:
SNR = Max Real Value from the NAA peak (e.g. .003) / Std Dev Real of the noise (e.g. 2.19501e-05)
18
Appendix 2
A flexible framework to have in mind while adjusting the guess parameters values:
Once the id_full_HSVD512.dat file, & the .cst and .ges files have been loaded in the middle panel:
1) Phase. While the spectrum is zoomed out for an overall assessment of the whole dataset, adjust the
phase of the yellow line (acquired data) using Phase Degrees and FT(1). That's for a visual assessment
on the screen.
E.g., FT(1) can be put at .0005s for adjusting the baseline of the .ges file.
2) Phase.
Open the .ges file and adjust the phase of the red line (guess). It needs to be very close to the acquired
data.
These units are in radians; e.g. pha value could be set at 1. Save the .ges file and reload.
3) Shift.
If this has not been done before: in order to have a good location on the X axis for the spectrum peaks,
go in View => Offset modification; a new window appears. Double click on the NAA peak and input
the ppm value of 2.01 in the box. OK.
Then zoom twice into the metabolite region for a closer assessment of the peaks. Look at the shift of
all the peaks as a whole. In the .ges file, re-adjust the pos value for a closer guess of the shift for all the
peaks together.
4) Width. The width Lorentzian (WL) could be adjusted in the .ges file for a better guess if there is an
important discrepancy between the red line and the yellow line.
5) Amplitude. The amplitude of the peaks can be re-adjusted in the .ges file for a closer guess; e.g. amp
can be set at .45.
6) Phase. Back into assessing the phase again in the .ges file, for polishing the guess of this important
parameter. e.g. pha could be re-set at 1.2 or 1.4.
When the best guess is achieved:
Save the .ges file and reload again.
Adjust the range for the fit in .cst file according to the number of data points ignored at the
beginning of the FID (the FT(1) adjustment) and cut off at the end of the FID (FT(2)
adjustment.
Generate the fit:
File =>Generate fit
input file: id_full_HSVD512.dat
output name: id_VOIname_fit1-400.out
OK
Visualize the output file (File => Output) and re-adjust Phase (Degrees).
If that first try at fitting the data does not yield the best fit, re-do the whole process again, this time
using the parameters of the id_VOIname_fit1-400.out file as a starting point.