MCPcopy Create free account
hub / github.com/dek924/PerX2CT / ToTensor

Class ToTensor

x2ct_nerf/preprocessing/X2CT_transform_3d.py:181–191  ·  view source on GitHub ↗

To Torch Tensor img: 3D, (z, y, x) or (D, H, W) Returns: img: 3d array, (z,y,x) or (D, H, W)

Source from the content-addressed store, hash-verified

179 return img
180
181class ToTensor(object):
182 '''
183 To Torch Tensor
184 img: 3D, (z, y, x) or (D, H, W)
185 Returns:
186 img: 3d array, (z,y,x) or (D, H, W)
187 '''
188 def __call__(self, img):
189 img = torch.from_numpy(img.astype(np.float32))
190
191 return img
192
193class Normalization(object):
194 '''

Callers 1

set_preprocessingMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected