Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    ValueError
Message:      Invalid string class label T1
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2386, in __iter__
                  example = _apply_feature_types_on_example(
                      example, self.features, token_per_repo_id=self.token_per_repo_id
                  )
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2303, in _apply_feature_types_on_example
                  encoded_example = features.encode_example(example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 2178, in encode_example
                  return encode_nested_example(self, example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1460, in encode_nested_example
                  {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema}
                      ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1483, in encode_nested_example
                  return schema.encode_example(obj) if obj is not None else None
                         ~~~~~~~~~~~~~~~~~~~~~^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1158, in encode_example
                  example_data = self.str2int(example_data)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1095, in str2int
                  output = [self._strval2int(value) for value in values]
                            ~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1116, in _strval2int
                  raise ValueError(f"Invalid string class label {value}")
              ValueError: Invalid string class label T1

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

FLAMeS Inference on MSLesSeg + ISBI + MSValid

Run FLAMeS (Dataset004_WML, nnUNet 3D fullres, FLAIR-only) on the MSLesSeg, ISBI and MSValid datasets. Model source: https://zenodo.org/records/17955359 (link.txt)

Folder structure

FLAMeS/
  MSLesSeg Dataset/            # original: train/Pxx/Ty/*FLAIR,T1,T2,MASK + test/Pxx/*
  FLAMeS_input/                # nested mirror, renamed *_FLAIR_0000.nii.gz + mapping csv
  FLAMeS_input_flat/           # flat for nnUNet: test/22 + train/93 files directly
    test/P54_T1_FLAIR_0000.nii.gz ...
    train/P1_T1_FLAIR_0000.nii.gz ...
    mapping_MSLesSeg_to_FLAMeS_flat.csv
  FLAMeS_input_flat_ISBI/      # flat for nnUNet, ISBI only, kept separate from MSLesSeg
    test/61x testXX_YY_FLAIR_0000.nii.gz ...   # from ISBI_testdata_website_2016-03-24/testdata_website/testXX/preprocessed/*_flair_pp.nii
    train/21x trainingXX_YY_FLAIR_0000.nii.gz ... # from ISBI_training_final_v4/training/trainingXX/preprocessed/*_flair_pp.nii
    mapping_ISBI_to_FLAMeS_flat.csv
  FLAMeS_output/test/ train/   # MSLesSeg predictions, filled by predict
  FLAMeS_output_ISBI/test/ train/ # ISBI predictions (create before predict)
  FLAMeS_input_flat_MSValid/   # flat for nnUNet, MSValid only, kept separate
    valid/133x Pxx_Ty_FLAIR_0000.nii.gz ... # from MSValid/MSValid/Pxx/Ty/Pxx_Ty_FLAIR.nii.gz (no masks)
    mapping_MSValid_to_FLAMeS_flat.csv
  FLAMeS_output_MSValid/valid/ # MSValid predictions
  nnUNet_raw/                  # required empty
  nnUNet_preprocessed/         # required empty
  nnUNet_results/
    Dataset004_WML/
      nnUNetTrainer_8000epochs__nnUNetPlans__3d_fullres/
        plans.json, dataset.json, dataset_fingerprint.json, fold_0..4/
  Dataset004_WML.zip           # original download backup
  requirements.txt             # nnunetv2

MSLesSeg is already preprocessed (brain-extracted, MNI152 182x218x182), so no SynthStrip needed. Input is FLAIR-only (_0000).

ISBI source layout (read-only, FLAIR-only from preprocessed/): ISBI_training_final_v4/training/training01-05/{orig,preprocessed,masks}/ (21 FLAIR *_flair_pp.nii, 42 masks *_mask1.nii + *_mask2.nii, 2 raters) and ISBI_testdata_website_2016-03-24/testdata_website/test01-14/{orig,preprocessed}/ (61 FLAIR *_flair_pp.nii, no masks released). Flat names are {subject}_{timepoint}_FLAIR_0000.nii.gz (e.g. training01_01_FLAIR_0000.nii.gz, test01_01_FLAIR_0000.nii.gz), gzip of the .nii, kept separate in FLAMeS_input_flat_ISBI/.

MSValid source layout (read-only, FLAIR-only): MSValid/MSValid/P1-P84/Ty/Pxx_Ty_{FLAIR,T1,T2}.nii.gz (133 FLAIR total, e.g. 512x512x81 uint16, no MASK files). Flat copy + rename to Pxx_Ty_FLAIR_0000.nii.gz (byte copy, content unchanged), kept separate in FLAMeS_input_flat_MSValid/valid/.

Setup (Linux)

python --version          # 3.10 / 3.11 recommended
pip install -r requirements.txt

export nnUNet_raw=$(pwd)/nnUNet_raw
export nnUNet_preprocessed=$(pwd)/nnUNet_preprocessed
export nnUNet_results=$(pwd)/nnUNet_results

No custom code needed. Do not rename model folder — nnUNetv2_predict -d 004 expects exactly nnUNet_results/Dataset004_WML/....

Inference

MSLesSeg:

nnUNetv2_predict -i FLAMeS_input_flat/test -o FLAMeS_output/test \
  -d 004 -c 3d_fullres -tr nnUNetTrainer_8000epochs

nnUNetv2_predict -i FLAMeS_input_flat/train -o FLAMeS_output/train \
  -d 004 -c 3d_fullres -tr nnUNetTrainer_8000epochs

ISBI (separate folders):

nnUNetv2_predict -i FLAMeS_input_flat_ISBI/test -o FLAMeS_output_ISBI/test \
  -d 004 -c 3d_fullres -tr nnUNetTrainer_8000epochs

nnUNetv2_predict -i FLAMeS_input_flat_ISBI/train -o FLAMeS_output_ISBI/train \
  -d 004 -c 3d_fullres -tr nnUNetTrainer_8000epochs

MSValid (separate folder, single valid split):

nnUNetv2_predict -i FLAMeS_input_flat_MSValid/valid -o FLAMeS_output_MSValid/valid \
  -d 004 -c 3d_fullres -tr nnUNetTrainer_8000epochs
  • Default 5-fold ensemble + TTA mirroring, ~20s/case on GPU (minutes on CPU).
  • Input must stay flat (*_0000.nii.gz, no subfolders). Output is flat (P54_T1_FLAIR.nii.gz, binary 0/1).
  • No postprocessing.pkl in this model — skip nnUNetv2_apply_postprocessing.

Mapping back

MSLesSeg — use FLAMeS_input_flat/mapping_MSLesSeg_to_FLAMeS_flat.csv:

split,patient,timepoint,nnunet_case_id,original_flair,original_mask,flames_input,flames_filename,flames_input_flat,nnunet_output_expected

Join nnunet_output_expected -> original_mask for Dice / evaluation.

ISBI — use FLAMeS_input_flat_ISBI/mapping_ISBI_to_FLAMeS_flat.csv:

split,subject,timepoint,nnunet_case_id,original_flair,original_mask1,original_mask2,flames_filename,flames_input_flat,nnunet_output_expected

train (21x) has original_mask1 + original_mask2 (2 raters, trainingXX/masks/trainingXX_YY_mask{1,2}.nii); test (61x) has empty mask fields (no masks released). Join nnunet_output_expected -> original_mask1/2 for evaluation.

MSValid — use FLAMeS_input_flat_MSValid/mapping_MSValid_to_FLAMeS_flat.csv (133 rows):

split,patient,timepoint,nnunet_case_id,original_flair,original_mask,flames_filename,flames_input_flat,nnunet_output_expected

split is always valid, original_mask is empty (no masks in MSValid/). Output is FLAMeS_output_MSValid/valid/Pxx_Ty_FLAIR.nii.gz.

Downloads last month
148