I'm trying to implement a Conditional GAN in NiftyNet.
I have a collection of 3D images in Nifti format, each of a specific class. The class should be the conditioning input for the GAN.
So far I have managed to make it work, but it's kind of a hack: I create a 1x1x1 dummy image corresponding to each 3D image, which contains the class as its single value. Then, in my config file (... stand for omissions):
[images]
csv_file = index.csv ; This contains the subject_id to path correspondence
...
[labels]
csv_file = labels.csv ; This contains the subject_id to path to the dummy image correspondence
interp_order = 0
spatial_window_size = (1)
...
[SYSTEM]
...
dataset_split_file = fold0.csv
...
[GAN]
image=images
conditioning=labels
...
Although it technically works, it's very flimsy. I would like to specify the class with a CSV file with columns subject_id and target.
I've tried the following, using the undocumented csv_data_file parameter in the input description:
[images]
csv_file = index.csv ; This contains the subject_id to path correspondence
...
[labels]
csv_data_file = ./modality_labels.csv
to_ohe = False
...
[SYSTEM]
...
dataset_split_file = fold0.csv
...
[GAN]
image=images
conditioning=labels
...
but I get the following error:
CRITICAL:niftynet: Reader required input section name [labels], but in the filename list the column is empty.
CRITICAL:niftynet: file_list parameter should be a pandas.DataFrame instance and has input section name [labels] as a column name.
CRITICAL:niftynet: Reader requires section(s): ['images', 'labels']
CRITICAL:niftynet: Configuration input sections are: ['subject_id', 'images']
What would be the correct way to specify it?