MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/data/image_reader.py:440–468  ·  view source on GitHub ↗
(
        self,
        channel_dim: str | int | None = None,
        affine_lps_to_ras: bool = True,
        swap_ij: bool = True,
        prune_metadata: bool = True,
        label_dict: dict | None = None,
        fname_regex: str = "",
        to_gpu: bool = False,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

438 """
439
440 def __init__(
441 self,
442 channel_dim: str | int | None = None,
443 affine_lps_to_ras: bool = True,
444 swap_ij: bool = True,
445 prune_metadata: bool = True,
446 label_dict: dict | None = None,
447 fname_regex: str = "",
448 to_gpu: bool = False,
449 **kwargs,
450 ):
451 super().__init__()
452 self.kwargs = kwargs
453 self.channel_dim = float("nan") if channel_dim == "no_channel" else channel_dim
454 self.affine_lps_to_ras = affine_lps_to_ras
455 self.swap_ij = swap_ij
456 self.prune_metadata = prune_metadata
457 self.label_dict = label_dict
458 self.fname_regex = fname_regex
459 if to_gpu and (not has_cp or not has_kvikio):
460 warnings.warn(
461 "PydicomReader: CuPy and/or Kvikio not installed for GPU loading, falling back to CPU loading."
462 )
463 to_gpu = False
464
465 if to_gpu:
466 self.warmup_kvikio()
467
468 self.to_gpu = to_gpu
469
470 def warmup_kvikio(self):
471 """

Callers

nothing calls this directly

Calls 2

warmup_kvikioMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected