MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / initialize

Method initialize

tests/nonconfig_workflow.py:199–218  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

197 self.dataflow: dict = {}
198
199 def initialize(self):
200 self._props_vals = {}
201 self._is_initialized = True
202 self.net = UNet(
203 spatial_dims=3,
204 in_channels=1,
205 out_channels=2,
206 channels=(16, 32, 64, 128),
207 strides=(2, 2, 2),
208 num_res_units=2,
209 ).to(self.device)
210 preprocessing = Compose(
211 [
212 EnsureChannelFirstd(keys=["image"]),
213 ScaleIntensityd(keys="image"),
214 ScaleIntensityRanged(keys="image", a_min=-57, a_max=164, b_min=0.0, b_max=1.0, clip=True),
215 ]
216 )
217 self.dataset = Dataset(data=[self.dataflow], transform=preprocessing)
218 self.postprocessing = Compose([Activationsd(keys="pred", softmax=True), AsDiscreted(keys="pred", argmax=True)])
219
220 def run(self):
221 data = self.dataset[0]

Callers 1

Calls 8

UNetClass · 0.90
ComposeClass · 0.90
EnsureChannelFirstdClass · 0.90
ScaleIntensitydClass · 0.90
DatasetClass · 0.90
ActivationsdClass · 0.90
AsDiscretedClass · 0.90

Tested by 1