ivadomed/ms-lesion-agnostic

Look for axial T2/T2* images

plbenveniste opened this issue · 5 comments

Opening this issue to reference all the data that we have, which is axial T2 and T2* images.

@naga-karthik This is being delayed by data-management issues related to the Bidsification of the beijing and the karolinska dataset. But I haven't forgotten about it.

Sure, no worries! thank you for the update! :)

Here are the dataset I looked into:

  • basel-mp2rage: MP2RAGE
  • bavaria-quebec-spine-ms-unstitched: T2w
  • canproco: PSIR and STIR contrast
  • nih-ms-mp2rage : MPRAGE
  • sct-testing-large : T1w, T2w and T2*w

I didn't look at the following datasets (ms-nmo-beijing, ms-nyu, ms-karolinska-2020, ms-basel-2020 and ms-basel-2018) as they don't contain segmented T2w images (or in the case of ms-karolinska-2020 the segmentated images are included in sct-testing-large).

Code used
import json

path_json = "/Users/plbenveniste/moneta/users/pierrelouis/ms-lesion-agnostic/msd_data/dataset_2024-07-24_seed42_lesionOnly.json"

# Load the json file
with open(path_json, 'r') as f:
    data = json.load(f)

# Comcat images
images = data['test'] + data['train'] + data['validation']

# Initialize the list of images
axT2w_images = []

#  Iterate over the images
for image in images: 
    if image['contrast'] == 'T2w' and image['orientation'] == 'ax':
        axT2w_images.append(image)

print(f"Number of axial T2w images: {len(axT2w_images)}")

# Group the images per site and print the number of images per site
sites = {}
for image in axT2w_images:
    site = image['site']
    if site not in sites:
        sites[site] = []
    sites[site].append(image)

for site, images in sites.items():
    print(f"Site: {site}, number of images: {len(images)}")

The output was the following:

Number of axial T2w images: 1234
Site: bavaria-quebec, number of images: 986
Site: sct-testing-large, number of images: 248