RegNet icon indicating copy to clipboard operation
RegNet copied to clipboard

Loading data?

Open markemus opened this issue 7 years ago • 2 comments

Hi @hsokooti I'm having trouble figuring out how to preprocess and load data into the net. I saw your post linking some datasets, but the model seems to load *.mha files and they all seem to be in other formats. Additionally, I'm not sure where to put the data in the directory structure; the documentation seems to be outdated and the setting["DLFolder"] key doesn't exist anymore.

markemus avatar Nov 07 '18 15:11 markemus

Dear markemus,

I updated the documentation. About the extension, you can define it for your own database in the setting_utils.py. For example, in line 88, this is defined for the DIR-Lab_4D:

    elif selected_data == 'DIR-Lab_4D':
        data_setting['Dim'] = '3D'
        data_setting['ext'] = '.mha'
        data_setting['imageByte'] = 2              # equals to sitk.sitkInt16 , we prefer not to import sitk in SettingUtils
        data_setting['types'] = ['T00', 'T10', 'T20', 'T30', 'T40', 'T50', 'T60', 'T70', 'T80', 'T90']     # for eg: 'Fixed' or 'Moving' : actually Fixed indicates baseline and Moving indicates followup
        data_setting['expPrefix'] = 'case'         # for eg: case1
        data_setting['defaultPixelValue'] = -2048  # The pixel value when a transformed pixel is outside of the image
        data_setting['voxelSize'] = [1, 1, 1]
        data_setting['AffineRegistration'] = True
        data_setting['UnsureLandmarkAvailable'] = False
        data_setting['CNList'] = [i for i in range(1, 11)]

To check all addresses, I suggest running and testing the following line:

original_image_address = su.address_generator(setting, 'originalIm', data='DIR-Lab_4D', cn=1, type_im=0, stage=1)

I hope that this can help.

hsokooti avatar Nov 07 '18 21:11 hsokooti

Very helpful, thank you!

markemus avatar Nov 08 '18 16:11 markemus