MS MRI Lesion Segmentation Processing

via Freelancer ·

Budget / Salary$250–750
TypeFreelance project
LocationRemote
Posted1 hour ago
I need an experienced medical imaging freelancer to implement, run, and verify the workflow below for every patient and available time point in my longitudinal multiple sclerosis (MS) MRI dataset.

You may use Claude or a comparable AI coding assistant to develop the pipeline. Perform image analysis using suitable neuroimaging software and an MS lesion segmentation method validated for the available sequences. Deliver the completed analysis, images, masks, Excel workbook, QC overlays, and reproducible code.

**Dataset:** [Google Drive MRI dataset (90 pt with average of 6 procedures (time points for each))]

Available sequences may include T1-weighted precontrast (T1pre), T1-weighted postcontrast (T1post), and FLAIR. Process downloaded copies and upload completed outputs to the source Google Drive folder. Preserve originals and maintain confidentiality using the agreed computing and storage environment.

**1. Organize and identify scans**

Create a folder named exactly **MS segmentation** inside the source directory:

`MS segmentation///`

Preserve patient/time-point names and exclude the output folder from input searches. Match sequences from the same examination. Verify contrast status using available metadata, rather than filenames alone. Document missing sequences or ambiguous matches.

Record scan date and patient age at each examination where available. Use the recorded examination age or calculate age from verified birth and scan dates. Enter NA if unavailable.

**2. Preprocess and register**

Apply N4 bias correction and intensity normalization appropriate for the segmentation method to each available sequence. Use compatible T1pre/T1post intensity matching that preserves genuine enhancement. Compare original and processed images to check that processing has not created or obscured enhancement.

Rigidly coregister same-visit sequences and verify T1pre/T1post alignment before assessing enhancement. Keep patients and time points separate. Retain transformations and combine them where possible to minimize repeated interpolation.

Use registered working copies for analysis. Save final preprocessed images on their respective original grids and transform masks back to each native grid.

**3. Segment lesions and classify enhancement**

Use a validated MS lesion segmentation method and document its model/version, required inputs, and validation evidence. Confirm that outputs represent MS lesions, rather than normal white matter or general brain tissue.

Use FLAIR to establish total lesion extent, supported by T1pre where appropriate. Assess enhancement by comparing matched, aligned T1post and T1pre using a suitable enhancement-detection method.

Cross-check enhancement candidates against FLAIR and original T1 images. Exclude obvious vessels, normally enhancing structures, intrinsic T1 hyperintensity, and processing artifacts.

Classify whole lesions as:

- Nonenhancing MS white-matter lesion.
- Enhancing MS lesion.
- Enhancement status indeterminate when assessment is unreliable or required sequences are missing.

Missing T1post must not be interpreted as absence of enhancement. Flag uncertain findings for review. Assign focal or ring enhancement to the **whole lesion**; do not classify a ring lesion's center as a separate nonenhancing lesion.

A FLAIR segmentation model does not automatically classify enhancement. Use a suitable method for each task. If a capability or sequence is unavailable, document the limitation and complete supported outputs.

**4. Generate masks and NIfTI outputs**

Create a binary FLAIR lesion mask:

- 0 = background/nonlesion tissue.
- 1 = MS lesion.

Create separate multiclass masks on the original T1pre and T1post grids:

- 0 = background/nonlesion tissue, including normal white matter.
- 1 = nonenhancing MS white-matter lesion.
- 2 = enhancing MS lesion.
- 3 = MS lesion with indeterminate enhancement status.

Determine classifications from the matched sequences, then export them to each available T1 native grid. T1pre/T1post masks must represent the same classifications in their respective spaces.

These labels describe whole lesions categorized by enhancement status. If exact enhancing tissue can also be segmented, save it separately as a binary mask and report its volume separately.

Save successfully generated outputs as **uncompressed .nii** files:

```text
__T1pre_Preprocessed.nii
__T1post_Preprocessed.nii
__FLAIR_Preprocessed.nii
__FLAIR_MS_LesionMask.nii
__T1pre_MS_LesionLabels.nii
__T1post_MS_LesionLabels.nii
```

Optional, when successfully generated:
`__T1post_EnhancingTissueMask.nii`

Use existing patient/time-point names in filenames. Preserve each original scan's dimensions, voxel spacing, orientation, and spatial coordinates in its corresponding preprocessed image and mask. Use nearest-neighbor interpolation for masks and integer labels. Report missing or failed outputs.

**5. Create MS_Lesion_Analysis.xlsx**

Save the workbook inside **MS segmentation**, with these worksheets:

**A. Lesion_Summary**

One row per patient, time point, enhancement group, and anatomical category.

Columns: Patient ID; Time point; Scan date; Patient age at scan (years); Enhancement group; Anatomical category; Lesion count; Lesion volume (cm³); Lesion volume (% of ICV); Lesion burden (% of WM); Measurement reference space; Corresponding mask paths; QC status/comments.

Enhancement groups:

- All lesions.
- Enhancing lesions.
- Nonenhancing white-matter lesions.
- Enhancement status indeterminate.

For each group, report: Total, Periventricular, Deep white matter, Juxtacortical, Infratentorial, and Unclassified where necessary.

Use an anatomical segmentation or atlas-based method. Document one consistent classification rule, assign each lesion to one anatomical category, and avoid double counting lesions spanning regions. Total rows are aggregates, not additional categories to sum.

**B. Individual_Lesions**

One row per lesion.

Columns: Patient ID; Time point; Scan date; Age at scan (years); Lesion ID; Anatomical category; Enhancement status; Voxel count; Volume (mm³); Volume (cm³); Volume (% of ICV); Lesion burden (% of WM); Measurement reference space; QC comments.

When available, add **Enhancing tissue volume (cm³)**. Keep this separate from the full volume of a lesion classified as enhancing.

Lesion IDs are specific to each time point unless reliable longitudinal matching has been performed and documented.

**C. Reference_Volumes**

Columns: Patient ID; Time point; Age at scan (years); Intracranial volume (cm³); Total white-matter volume including lesions (cm³); Measurement source/method; QC comments.

Calculations:

- Lesion volume (cm³) = lesion voxel count × voxel volume (mm³) ÷ 1000.
- Lesion volume (% of ICV) = lesion volume (cm³) ÷ intracranial volume (cm³) × 100.
- Lesion burden (% of WM) = lesion volume (cm³) ÷ total white-matter volume including lesions (cm³) × 100.

Use the same reference volumes for all enhancement groups within each patient/time point.

Calculate primary lesion counts and whole-lesion volumes once on a clearly identified reference grid, preferably native FLAIR. Do not count exported T1 copies as additional lesions.

Keep measurements in separate numeric columns. Display volumes and percentages to four decimal places and counts as integers. Use Excel formulas where appropriate.

Use NA for unavailable/unreliable measurements and explain why. Use 0 only when processing succeeded and the category was absent. Do not fabricate measurements or infer reference volumes from example values.

**6. Quality control and completion report**

Save overlays in each patient/time-point folder:

- Total lesion mask over FLAIR.
- Classified lesions over T1pre, where available.
- Classified lesions over T1post, where available.

Legend: green = nonenhancing; red = enhancing; yellow = indeterminate. Use a clearly labeled single color for the binary total-lesion overlay.

Check registration, native-space geometry, label values, anatomical classification, obvious false positives/missed lesions, and agreement between masks and Excel measurements.

Confirm that enhancing, nonenhancing, and indeterminate groups reconcile with total lesion counts and volumes without overlap or double counting.

Provide a completion report covering patients/time points processed, available/missing sequences, successful outputs, missing measurements, failures with reasons, findings requiring expert review, and the output folder/workbook locations. Verify that delivered files are present and readable.

**7. Reproducibility and execution**

Deliver executable scripts, configuration files, parameters, software/dependency versions, model versions and weight sources, registration transformations, processing logs, a completion/failure manifest, and reproduction instructions.
data processing matlab and mathematica machine learning (ml) image processing data analysis deep learning data management
Apply on Freelancer →

Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.