MCPcopy Create free account

hub / github.com/Project-MONAI/MONAI / functions

Functions7,906 in github.com/Project-MONAI/MONAI

↓ 2 callersMethodget_lrs_and_losses
Get learning rates and their corresponding losses Args: skip_start: number of batches to trim from the start. skip_en
monai/optimizers/lr_finder.py:448
↓ 2 callersMethodget_max_roi_size
(self, img_size)
monai/transforms/croppad/array.py:670
↓ 2 callersFunctionget_medicalnet_pretrained_resnet_args
Return correct shortcut_type and bias_downsample for pretrained MedicalNet weights according to resnet depth.
monai/networks/nets/resnet.py:675
↓ 2 callersMethodget_module_list
( self, in_channels: list[int], out_channels: list[int], kernel_size: Sequence
monai/networks/nets/dynunet.py:324
↓ 2 callersFunctionget_net_parameters
Returns the total number of parameters in a Module.
tests/networks/nets/test_attentionunet.py:23
↓ 2 callersMethodget_num_classes
Get number of classes.
monai/apps/datasets.py:151
↓ 2 callersMethodget_num_frames
Return the number of frames in a video file. Raises: RuntimeError: no frames found.
monai/data/video_dataset.py:187
↓ 2 callersFunctionget_number_image_type_conversions
Get the number of times that the data need to be converted (e.g., numpy to torch). Conversions between different devices are also counted (e.
monai/transforms/utils.py:1926
↓ 2 callersFunctionget_numpy_dtype_from_string
Get a numpy dtype (e.g., `np.float32`) from its string (e.g., `"float32"`).
monai/utils/type_conversion.py:47
↓ 2 callersMethodget_output_block
(self, idx: int)
monai/networks/nets/dynunet.py:302
↓ 2 callersFunctionget_profile_shapes
Given a sample input shape, calculate min/opt/max shapes according to dynamic_batchsize.
monai/networks/utils.py:76
↓ 2 callersMethodget_ram_cost_usage
Get estimated output tensor size to approximate RAM consumption. Args: in_size: input image shape (4D/5D, ``[BCHW[D]]``)
monai/networks/nets/dints.py:873
↓ 2 callersFunctionget_random_patch
Returns a tuple of slices to define a random patch in an array of shape `dims` with size `patch_size` or the as close to it as possible withi
monai/data/utils.py:105
↓ 2 callersFunctionget_rel_pos_embedding_layer
(name: tuple | str, s_input_dims: tuple | None, c_dim: int, num_heads: int)
monai/networks/layers/utils.py:129
↓ 2 callersMethodget_result_from_layer_blocks
This is equivalent to self.layer_blocks[idx](x), but torchscript doesn't support this yet
monai/networks/blocks/feature_pyramid_network.py:220
↓ 2 callersMethodget_size
Returns the size (height, width) of the whole slide image at a given level. Args: wsi: a whole slide image object loaded
monai/data/wsi_reader.py:136
↓ 2 callersMethodget_stacked_torch
Get either a sequence or single instance of np.ndarray/torch.Tensor. Return single torch.Tensor.
monai/transforms/post/array.py:645
↓ 2 callersMethodget_steepest_gradient
Get learning rate which has steepest gradient and its corresponding loss Args: skip_start: number of batches to trim from the sta
monai/optimizers/lr_finder.py:468
↓ 2 callersMethodget_target_spacing
Calculate the target spacing according to all spacings. If the target spacing is very anisotropic, decrease the spacing value
monai/data/dataset_summary.py:96
↓ 2 callersFunctionget_tcia_ref_uid
Achieve the referenced UID from the referenced Series Sequence for the input pydicom dataset object. The referenced UID could be Series Insta
monai/apps/tcia/utils.py:117
↓ 2 callersMethodget_times_summary
Returns a dictionary mapping results entries to tuples containing the number of items, time sum, time average, time std dev, time min
monai/utils/profiling.py:358
↓ 2 callersFunctionget_torch_dtype_from_string
Get a torch dtype (e.g., `torch.float32`) from its string (e.g., `"float32"`).
monai/utils/type_conversion.py:52
↓ 2 callersFunctionget_torch_version_tuple
Returns: tuple of ints represents the pytorch major/minor version.
monai/utils/module.py:504
↓ 2 callersFunctionget_transform_backends
Get the backends of all MONAI transforms. Returns: Dictionary, where each key is a transform, and its corresponding values are a
monai/transforms/utils.py:1963
↓ 2 callersFunctionget_up_block
( spatial_dims: int, in_channels: int, prev_output_channel: int, out_channels: int, temb_c
monai/networks/nets/diffusion_model_unet.py:1432
↓ 2 callersFunctionget_upsample_layer
( spatial_dims: int, in_channels: int, upsample_mode: UpsampleMode | str = "nontrainable", scale_factor: i
monai/networks/blocks/segresnet_block.py:30
↓ 2 callersMethodget_velocity
(self, sample: torch.Tensor, noise: torch.Tensor, timesteps: torch.Tensor)
monai/networks/schedulers/scheduler.py:196
↓ 2 callersFunctionget_versions
Get version information or return default if unable to do so.
monai/_version.py:614
↓ 2 callersMethodget_zero_tensor
Gets a zero tensor. Args: input: tensor which shape you want the zeros tensor to correspond to. Returns:
monai/losses/adversarial_loss.py:98
↓ 2 callersFunctionhas_status_keys
Checks whether a given tensor is has a particular status key message on any of its applied operations. If it doesn't, it returns the tuple `(
monai/transforms/utils.py:2398
↓ 2 callersMethodinfer
Runs TRT engine. Args: stream: CUDA stream to run on use_cuda_graph: use CUDA graph. Note: requires all input
monai/networks/trt_compiler.py:204
↓ 2 callersFunctioninit
Initialize the image writer modules according to the filename extension.
monai/data/image_writer.py:865
↓ 2 callersMethodinit_logger
(self, name=LOGGER_NAME)
tests/transforms/compose/test_compose.py:682
↓ 2 callersMethodinstantiate
Instantiate the target component and return the instance.
monai/bundle/config_item.py:43
↓ 2 callersMethodinstantiate
Instantiate component based on ``self.config`` content. The target component must be a `class` or a `function`, otherwise, return `No
monai/bundle/config_item.py:275
↓ 2 callersMethodinverse
(self, data: Mapping[Hashable, torch.Tensor])
monai/transforms/utility/dictionary.py:1920
↓ 2 callersMethodinverse
(self, data: torch.Tensor)
monai/transforms/utility/array.py:841
↓ 2 callersMethodinverse
(self, data: torch.Tensor)
monai/transforms/spatial/array.py:549
↓ 2 callersMethodinverse
(self, data: Mapping[Hashable, MetaTensor])
monai/transforms/croppad/dictionary.py:174
↓ 2 callersMethodinverse
Inverse of the crop transform, restoring the original spatial dimensions via padding. For the string-key path, the cropper used in `
monai/transforms/croppad/dictionary.py:571
↓ 2 callersMethodinverse
(self, img: MetaTensor)
monai/transforms/croppad/array.py:943
↓ 2 callersMethodinverse
(self, img: MetaTensor)
monai/transforms/croppad/array.py:1489
↓ 2 callersFunctioninverse_divisible_pad_t
De-pad network output to match its original shape Args: x: input of shape (B,C,H,W) for 2D data or (B,C,H,W,D) for 3D data p
monai/apps/reconstruction/networks/nets/utils.py:231
↓ 2 callersMethodinverse_transform
(self, img: MetaTensor, transform)
monai/transforms/croppad/array.py:1493
↓ 2 callersMethodis_ddf_shaped
Check if the data is a DDF.
monai/transforms/lazy/utils.py:57
↓ 2 callersMethodis_valid_shape
Calculate if the input shape is divisible by the minimum factors for the current network configuration
monai/networks/nets/segresnet_ds.py:397
↓ 2 callersMethoditk_warp
Warping with python itk Args: image: itk image of array shape 2D: (H, W) or 3D: (D, H, W) ddf: numpy array of
tests/data/test_itk_torch_bridge.py:177
↓ 2 callersFunctionkeep_merge_components_with_points
Keep connected regions of img_pos and img_neg that include the positive points and negative points separately. The function is used for mergi
monai/transforms/utils.py:1200
↓ 2 callersFunctionkwargs_from_pending
Extract kwargs from a pending transform item. When ``pending_item`` is a dict, ``align_corners`` is also extracted from its ``extra_info`` entry
monai/transforms/lazy/utils.py:92
↓ 2 callersMethodload_state_dict
Restore state from a dictionary. Args: state: A dictionary containing the state to restore.
monai/apps/auto3dseg/bundle_gen.py:394
↓ 2 callersFunctionmaemetric_np
(y_pred, y)
tests/handlers/test_handler_regression_metrics_dist.py:36
↓ 2 callersFunctionmake_rand_affine
Create random affine transformation (with values == -1, 0 or 1).
tests/test_utils.py:421
↓ 2 callersMethodmask_percent
(self, img_np)
monai/apps/nuclick/transforms.py:252
↓ 2 callersMethodmatch_refs_pattern
Match regular expression for the input string to find the references. The reference string starts with ``"@"``, like: ``"@XXX::YYY::Z
monai/bundle/reference_resolver.py:260
↓ 2 callersFunctionmedicalnet_intensity_normalisation
Based on https://github.com/Tencent/MedicalNet/blob/18c8bb6cd564eb1b964bffef1f4c2283f1ae6e7b/datasets/brains18.py#L133
monai/losses/perceptual.py:318
↓ 2 callersFunctionmerge_kv
Update the `args` dict-like object with the key/value pair `k` and `v`.
monai/bundle/utils.py:246
↓ 2 callersFunctionmeshgrid_xy
(*tensors)
monai/networks/utils.py:1086
↓ 2 callersFunctionmetatensor_to_itk_image
Converts a MetaTensor object to an ITK image. Expects the MetaTensor to be in ChannelFirst format. Args: meta_tensor: The MetaTensor
monai/data/itk_torch_bridge.py:69
↓ 2 callersMethodmeth1
(self)
tests/utils/test_deprecated.py:149
↓ 2 callersFunctionmonai_to_itk_affine
Converts a MONAI affine matrix to an ITK affine matrix (2x2 for 2D or 3x3 for 3D matrix and translation vector). See also 'itk_to_monai_affin
monai/data/itk_torch_bridge.py:157
↓ 2 callersMethodmonai_warp
Warping with MONAI Args: image_tensor: torch tensor of shape 2D: (1, 1, H, W) and 3D: (1, 1, D, H, W) ddf_ten
tests/data/test_itk_torch_bridge.py:197
↓ 2 callersFunctionmsemetric_np
(y_pred, y)
tests/handlers/test_handler_regression_metrics_dist.py:32
↓ 2 callersMethodnetwork_wrapper
Wrapper handles inference for 2D models over 3D volume inputs.
monai/inferers/inferer.py:817
↓ 2 callersFunctionnorm_cdf
(x)
monai/networks/layers/weight_init.py:33
↓ 2 callersMethodnormalize_meta_id
Update deprecated identifiers in `config` using `DEPRECATED_ID_MAPPING`. This will replace names that are marked as deprecated with t
monai/bundle/reference_resolver.py:215
↓ 2 callersMethodnrrd_rw
(self, test_data, reader, writer, dtype, resample=True)
tests/data/test_image_rw.py:162
↓ 2 callersMethodopen_video
Use OpenCV to open a video source from either file or capture device. Args: video_source: filename or index referring to
monai/data/video_dataset.py:113
↓ 2 callersFunctionparse_version_strs
Parse the version strings.
monai/utils/module.py:512
↓ 2 callersMethodparzen_windowing_b_spline
Parzen windowing with b-spline kernel (adapted from ITK) Args: img: the shape should be B[NDHW]. order: int.
monai/losses/image_dissimilarity.py:259
↓ 2 callersMethodparzen_windowing_gaussian
Parzen windowing with gaussian kernel (adapted from DeepReg implementation) Note: the input is expected to range between 0 and 1
monai/losses/image_dissimilarity.py:310
↓ 2 callersFunctionpixelshuffle
Apply pixel shuffle to the tensor `x` with spatial dimensions `spatial_dims` and scaling factor `scale_factor`. See: Shi et al., 2016, "Real
monai/networks/utils.py:370
↓ 2 callersMethodpng_rw
(self, test_data, reader, writer, dtype, resample=True)
tests/data/test_image_rw.py:106
↓ 2 callersMethodpost_convert
(img: torch.Tensor, orig_img: Sequence[NdarrayOrTensor] | NdarrayOrTensor)
monai/transforms/post/array.py:655
↓ 2 callersMethodpredict_ensemble_postprocessing
Run prediction, ensemble, and/or postprocessing optionally. Args: folds: which folds to use run_ensemble: wh
monai/apps/nnunet/nnunetv2_runner.py:920
↓ 2 callersMethodprepare_onehot
Prepares onehot encoded input for metric call.
monai/metrics/wrapper.py:70
↓ 2 callersFunctionprint_config
Print the package versions to `file`. Args: file: `print()` text stream file. Defaults to `sys.stdout`.
monai/config/deviceconfig.py:95
↓ 2 callersFunctionprint_debug_info
Print config (installed dependencies, etc.) and system info for debugging. Args: file: `print()` text stream file. Defaults to `sys.
monai/config/deviceconfig.py:245
↓ 2 callersFunctionprint_table_column
(name, torch, numpy, color=Colors.none)
monai/transforms/utils.py:2025
↓ 2 callersFunctionprint_transform_backends
Prints a list of backends of all MONAI transforms.
monai/transforms/utils.py:2013
↓ 2 callersFunctionprob2class
Compute the lab from the probability of predicted feature maps Args: sigmoid: If the sigmoid function should be used. thresh
monai/utils/misc.py:708
↓ 2 callersFunctionpsnrmetric_np
(max_val, y_pred, y)
tests/handlers/test_handler_regression_metrics_dist.py:44
↓ 2 callersMethodpush_applied_operation
(self, t: Any)
monai/data/meta_obj.py:205
↓ 2 callersMethodquantize
Given an input it projects it to the quantized space and returns additional tensors needed for EMA loss. Args: inputs: E
monai/networks/layers/vector_quantizer.py:90
↓ 2 callersMethodrandomize
(self, data: Any | None = None)
monai/transforms/compose.py:295
↓ 2 callersMethodrandomize
(self, data: Any | None = None)
monai/transforms/spatial/array.py:2546
↓ 2 callersMethodrandomize_choose_acceleration
If multiple values are provided for center_fractions and accelerations, this function selects one value uniformly for each tr
monai/apps/reconstruction/transforms/array.py:89
↓ 2 callersMethodrandomized_pop
Return the item at a randomized location `self._idx` in `buffer`.
monai/data/iterable_dataset.py:107
↓ 2 callersMethodread
Read image data from specified file or files, it can read a list of images and stack them together as multi-channel data in `get_data
monai/data/image_reader.py:1375
↓ 2 callersMethodregister
(self, reader: ImageReader)
monai/transforms/io/dictionary.py:151
↓ 2 callersFunctionremap_instance_id
This function is used to rename all instance id of `pred`, so that the id is contiguous. For example: all ids of the input can be [0, 1,
monai/metrics/utils.py:381
↓ 2 callersMethodremove_resolved_content
Remove the resolved ``ConfigItem`` by id. Args: id: id name of the expected item.
monai/bundle/reference_resolver.py:195
↓ 2 callersMethodreparameterize
(self, mu, logvar)
monai/networks/nets/spade_network.py:208
↓ 2 callersFunctionrepeat
`np.repeat` with equivalent implementation for torch (`repeat_interleave`). Args: a: input data to repeat. repeats: number o
monai/transforms/utils_pytorch_numpy_unification.py:364
↓ 2 callersFunctionreplace_modules
Replace sub-module(s) in a parent module. The name of the module to be replace can be nested e.g., `features.denseblock1.denselayer1.lay
monai/networks/utils.py:1131
↓ 2 callersMethodresample_if_needed
Convert the ``data_array`` into the coordinate system specified by ``target_affine``, from the current coordinate definition of ``aff
monai/data/image_writer.py:208
↓ 2 callersMethodreset
Reset the pandas `TextFileReader` iterable object to read data. For more details, please check: https://pandas.pydata.org/pandas-docs
monai/data/iterable_dataset.py:228
↓ 2 callersMethodreset
Restores the model and optimizer to their initial states.
monai/optimizers/lr_finder.py:249
↓ 2 callersFunctionreshape_batch_channel_to_channel_dim
Detaches batch and channel dimensions. Args: x: input of shape (B*C,1,H,W,2) for 2D data or (B*C,1,H,W,D,2) for 3D data batc
monai/apps/reconstruction/networks/nets/utils.py:104
↓ 2 callersFunctionreshape_channel_complex_to_last_dim
Swaps the complex dimension with the channel dimension so that the network output has 2 as its last dimension Args: x: input of shap
monai/apps/reconstruction/networks/nets/utils.py:52
↓ 2 callersFunctionreshape_channel_to_batch_dim
Combines batch and channel dimensions. Args: x: input of shape (B,C,H,W,2) for 2D data or (B,C,H,W,D,2) for 3D data Returns:
monai/apps/reconstruction/networks/nets/utils.py:79
← previousnext →1,101–1,200 of 7,906, ranked by callers