black0017 / MedicalZooPytorch

A pytorch-based deep learning framework for multi-modal 2D/3D medical image segmentation
MIT License
1.72k stars 299 forks source link

AttributeError: 'MRIDatasetMRBRAINS2018' object has no attribute 'affine' #14

Closed Healingl closed 3 years ago

Healingl commented 3 years ago

when load processed data, there is a bug

        if load:
            ## load pre-generated data
            self.list = utils.load_list(self.save_name)
            return
     ...
        self.affine = img_loader.load_affine_matrix(list_reg_t1[0]) # it is a bug
iliasprc commented 3 years ago

Hello, The param load=True uses presegmented patches from medical images that you have created when load=False. I think if you move the line ( self.affine=....) above the if loop the code should work fine

Healingl commented 3 years ago

@iliasprc Okay, I have solved this problem, thank you!