def __init__(self): super(PetExtract, self).__init__() in_channels = 1 self.conv_1 = nn.Conv3d(in_channels=in_channels, out_channels=32, kernel_size=3, padding=1) self.resnet_1 = _make_block(ResNet, input_channels=32)
def __init__(self): super(AttnPet, self).__init__() self.upsample_1 = _make_block(UpSample, input_channels=256) self.resnet_10 = _make_block(ResNet, input_channels=128) self.gate_1 = PetAttentionBlock3D(in_channels=128, pet_channels=32, gating_channels=256, inter_channels=128) self.upsample_2 = _make_block(UpSample, input_channels=128) self.resnet_11 = _make_block(ResNet, input_channels=64) self.gate_2 = PetAttentionBlock3D(in_channels=64, pet_channels=32, gating_channels=256, inter_channels=64) self.upsample_3 = _make_block(UpSample, input_channels=64) self.resnet_12 = _make_block(ResNet, input_channels=32) self.gate_3 = PetAttentionBlock3D(in_channels=32, pet_channels=32, gating_channels=256, inter_channels=32) self.conv_2 = nn.Conv3d(in_channels=32, out_channels=1, kernel_size=3, padding=1)
def __init__(self): super(Reg, self).__init__() self.conv_1 = nn.Conv3d(in_channels=1, out_channels=32, kernel_size=3, padding=1) self.drop = nn.Dropout(p=0.2) self.resnet_1 = _make_block(ResNet, input_channels=32) self.downsample_1 = _make_block(DownSample, input_channels=32) self.resnet_2 = _make_block(ResNet, input_channels=64) self.resnet_3 = _make_block(ResNet, input_channels=64) self.downsample_2 = _make_block(DownSample, input_channels=64) self.resnet_4 = _make_block(ResNet, input_channels=128) self.resnet_5 = _make_block(ResNet, input_channels=128) self.downsample_3 = _make_block(DownSample, input_channels=128) self.resnet_6 = _make_block(ResNet, input_channels=256) self.resnet_7 = _make_block(ResNet, input_channels=256) self.resnet_8 = _make_block(ResNet, input_channels=256) self.resnet_9 = _make_block(ResNet, input_channels=256) self.reg = _make_block(Regularizer)
def __init__(self, mask=None): super(SegPET, self).__init__() self.mask = mask self.conv_1 = nn.Conv3d(in_channels=1, out_channels=32, kernel_size=3, padding=1) self.drop = nn.Dropout(p=0.2) self.resnet_1 = _make_block(ResNet, input_channels=32) self.downsample_1 = _make_block(DownSample, input_channels=32) self.resnet_2 = _make_block(ResNet, input_channels=64) self.resnet_3 = _make_block(ResNet, input_channels=64) self.downsample_2 = _make_block(DownSample, input_channels=64) self.resnet_4 = _make_block(ResNet, input_channels=128) self.resnet_5 = _make_block(ResNet, input_channels=128) self.downsample_3 = _make_block(DownSample, input_channels=128) self.resnet_6 = _make_block(ResNet, input_channels=256) self.resnet_7 = _make_block(ResNet, input_channels=256) self.resnet_8 = _make_block(ResNet, input_channels=256) self.resnet_9 = _make_block(ResNet, input_channels=256) self.seg = Segmentation() self.pet = PET() self.grid_layer = None if self.mask == 'mask_prf': self.grid_layer = GridAttentionBlock3D(in_channels=1, gating_channels=256, inter_channels=1)
def __init__(self, both=False, attention=False): super(Seg, self).__init__() if both: in_channels = 2 else: in_channels = 1 self.conv_1 = nn.Conv3d(in_channels=in_channels, out_channels=32, kernel_size=3, padding=1) self.drop = nn.Dropout(p=0.2) self.resnet_1 = _make_block(ResNet, input_channels=32) self.downsample_1 = _make_block(DownSample, input_channels=32) self.resnet_2 = _make_block(ResNet, input_channels=64) self.resnet_3 = _make_block(ResNet, input_channels=64) self.downsample_2 = _make_block(DownSample, input_channels=64) self.resnet_4 = _make_block(ResNet, input_channels=128) self.resnet_5 = _make_block(ResNet, input_channels=128) self.downsample_3 = _make_block(DownSample, input_channels=128) self.resnet_6 = _make_block(ResNet, input_channels=256) self.resnet_7 = _make_block(ResNet, input_channels=256) self.resnet_8 = _make_block(ResNet, input_channels=256) self.resnet_9 = _make_block(ResNet, input_channels=256) if attention: self.seg = AttnSeg() else: self.seg = Segmentation()
def __init__(self): super(SegAttnPet, self).__init__() in_channels = 1 self.conv_1 = nn.Conv3d(in_channels=in_channels, out_channels=32, kernel_size=3, padding=1) self.drop = nn.Dropout(p=0.2) self.resnet_1 = _make_block(ResNet, input_channels=32) self.downsample_1 = _make_block(DownSample, input_channels=32) self.resnet_2 = _make_block(ResNet, input_channels=64) self.resnet_3 = _make_block(ResNet, input_channels=64) self.downsample_2 = _make_block(DownSample, input_channels=64) self.resnet_4 = _make_block(ResNet, input_channels=128) self.resnet_5 = _make_block(ResNet, input_channels=128) self.downsample_3 = _make_block(DownSample, input_channels=128) self.resnet_6 = _make_block(ResNet, input_channels=256) self.resnet_7 = _make_block(ResNet, input_channels=256) self.resnet_8 = _make_block(ResNet, input_channels=256) self.resnet_9 = _make_block(ResNet, input_channels=256) self.pet_extract = PetExtract() self.seg = AttnPet()