-
Notifications
You must be signed in to change notification settings - Fork 0
General Tips for Batch (Multiple‐Subject) Processing
Before starting here, we recommend that you read the instructions for single-subject analysis of your modality of interest:
Although S²M is designed to provide individual results and reports, it also supports batch processing, allowing multiple input data to be loaded and analyzed at the same time. Again, the results will remain individual, but loading multiple images at once enables additional options and preprocessing possibilities.
As an example, we will use the most complex case possible: the focal cortical dysplasia (FCD) Modality, including FLAIR images and a personalized harmonization procedure.
Images from 89 subjects acquired at the same center, using the same scanner and protocol, will be included:
Besides the T1-WI, FLAIR images from the same subjects, following the same alphabetical order, were also included:
For this sample, T1-WI and FLAIR images from 89 subjects were loaded.
Harmonization:
This sample comprises healthy controls and patients with epilepsy undergoing investigations for FCD. Note that FCD lesions are extremely heterogeneous and idiosyncratic. Their patterns vary in contrast, shape, size, and location, so there is no consistent overlap of lesions across subjects.
And what does this mean, or WHY are we saying all this?
The harmonization procedure minimizes batch differences, and this is genuinely what we want. However, if your loaded sample contains a pathological feature that is consistently present across subjects, the harmonization procedure may suppress this pattern as if it were a batch-related bias, similar to what it would do with scanner-, coil-, or protocol-specific signatures. Check this page for more details on S²M Harm. options. For FCD, as mentioned, the patterns are expected to vary considerably among subjects. However, even in these cases, the best practice for batch harmonization is to include healthy controls, either within the same batch or during a separate preprocessing run.
This sample contains images from 54 healthy controls and 35 patients. Our idea is to perform the harmonization to the whole sample but estimating the parameters only based on the loaded CONTROLS subjects.
- Click on the "Harmonize with the S²M ref. dataset" checkbox
- Among the available options, this time we will select "Estimate using loaded cases".
(This option will estimate the harmonization parameters and then apply the correction to all images)
- After clicking "Estimate using loaded cases", a question dialog will pop up asking, basically, whether you want to consider your entire sample (controls and patients) for harmonization ESTIMATION. In other words, whether you want to consider your entire loaded sample as reference subjects for harmonization.
-
By clicking "Yes", S²M will estimate the harmonization parameters from the entire sample and apply the correction to the whole sample.
-
By clicking "No" (which will be our choice here), the tool will ask you to provide a tabulated file (.xls, .xlsx, .txt, or .csv) containing a binary column vector indicating which subjects should be considered for harmonization estimation (1) and which should be excluded from the estimation and only corrected afterward (0):
A file like this should be loaded:
And you can check if S²M interpreted all correctly:
- Click on "Save and Close" button.
Using calming green text, S²M will reinforce your good decisions in the main GUI:
Besides defining age and sex through the GUI edit text fields, for multiple loaded cases, age and sex must be defined by loading specific files:
For age: a tabulated file (.xls, .xlsx, .txt, or .csv) containing a column vector with the age of each subject, in the same order as the loaded images. You can use the "Check Subject Order..." button in the same panel to double-check this order.
For sex: a tabulated file (.xls, .xlsx, .txt, or .csv) containing a binary column vector, with:
- 0 for female
- 1 for male
You can use the "Check Subject Order..." button in the same panel to double-check this order.
The next major difference when processing in batch is the enabling of the "Individualized Settings Panel". This panel was designed to enable the automatic selection of a case-centered Reference Dataset. If you decide to use this feature, instead of defining a fixed interval of minimum and maximum ages or a fixed sex criterion for the Reference Dataset used, you will define a relative age range, e.g., ±10 years, and specify whether only Reference Dataset controls of the same sex should be included or whether both sexes should be included. The algorithm will automatically and dynamically create individualized Reference Datasets based on the defined age range and sex criteria, using the loaded Age and Sex lists.
You can note the subpanel "Ref. Dataset: gap-filling option". Here is a brief explanation of what it means:
Consider the S²M available Reference Dataset. It consists of 188 controls, with ages ranging from 18 to 64 years, and four subjects for each age. This means that the age distribution within this dataset is homogeneous:
When you define, for example, a "Relative ± age (years)" of 10 in the GUI, it means that S²M will select controls with ages within ±10 years of the case's age. If the currently processed subject is 38 years old, S²M will include subjects from 28 to 48 years old for this particular analysis, resulting in a total of 84 subjects and a Reference Dataset centered on the case's age. No problem.
Now consider that the S²M Reference Dataset does not, unfortunately, have an equal sex distribution at each age. For example, at 36 years, we have 3 females and only 1 male. This can be tricky if you decide to use the "Same-sex controls only" option.
Using an age-range criterion of 10 years and before checking the "Same-sex controls only" option, as mentioned, our individualized Reference Dataset would contain 84 subjects. However, by checking "Same-sex controls only", the final sample size would vary depending on the sex distribution within the age range considered for each case. Right?
Now, consider another situation: a patient who is 18 years old, with an age range of ±10 years defined for the analysis. The S²M Reference Dataset does not contain normative data for subjects aged 8 to 17 years. This would also lead to a different final comparative sample size for this subject.
The "Ref. Dataset: gap-filling option" controls how S²M will behave in these and similar situations:
With the standard "Constant sample size" option, the S²M algorithm will automatically expand the age criteria until reaching the target sample size (84 subjects, in our example). This means that, when defining an age criterion of ±10 years, if a case is 18 years old, S²M will expand the Reference Dataset from 18 to 38 years, ensuring 84 subjects in the final normative Reference Dataset. The same type of expansion would be performed if "Same-sex controls only" is checked.
On the other hand, by checking the "Follow the defined rules" option, S²M will ignore sample size imbalances and simply follow your defined rules, without expanding the age criteria to fill gaps caused by limitations in the database's age or sex distribution/range.
Neuroimaging Laboratory, University of Campinas