File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -115,22 +115,18 @@ def project_forward(self, volume):
115
115
elif volume .shape [1 ] != 1 :
116
116
raise ValueError ('Only channel dimension of 1 is currently supported!' )
117
117
118
- projs = torch .zeros (volume .shape [0 ],
119
- self ._projection_shape [0 ],
120
- self ._projection_shape [1 ], device = 'cuda' ,
121
- requires_grad = volume .requires_grad )
122
-
118
+ projs = []
123
119
for i , slice in enumerate (volume ):
124
- projs [ i ] = _ForwardProjection ().apply (slice [0 ], State (
120
+ projs . append ( _ForwardProjection ().apply (slice [0 ], State (
125
121
self ._detector_origin ,
126
122
self ._detector_spacing ,
127
123
self ._projection_shape ,
128
124
self ._ray_vectors ,
129
125
self ._volume_origin ,
130
126
self ._volume_shape ,
131
127
self ._volume_spacing
132
- ))
133
- return projs
128
+ )))
129
+ return torch . stack ( projs , axis = 0 )
134
130
135
131
def project_backward (self , projection ):
136
132
projection = projection .float ().contiguous ().cuda ()
You can’t perform that action at this time.
0 commit comments