MCPcopy Index your code

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

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

↓ 21 callersMethodset_timesteps
Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference. Args: num_infe
monai/networks/schedulers/ddim.py:104
↓ 20 callersFunctionconcatenate
`np.concatenate` with equivalent implementation for torch (`torch.cat`).
monai/transforms/utils_pytorch_numpy_unification.py:312
↓ 19 callersFunctioncreate_grid
compute a `spatial_size` mesh. - when ``homogeneous=True``, the output shape is (N+1, dim_size_1, dim_size_2, ..., dim_size_N) -
monai/transforms/utils.py:761
↓ 19 callersMethodfirst_key
Get the first available key of `self.keys` in the input `data` dictionary. If no available key, return an empty tuple `()`.
monai/transforms/transform.py:491
↓ 18 callersMethod__init__
(self, alpha: float = 0.1)
monai/transforms/intensity/array.py:1948
↓ 18 callersFunction_empty_cuda_cache
(save_mem: bool)
monai/apps/generation/maisi/networks/autoencoderkl_maisi.py:31
↓ 18 callersMethodencode
(self, images: torch.Tensor)
monai/networks/nets/vqvae.py:430
↓ 18 callersFunctionlist_data_collate
Enhancement for PyTorch DataLoader default collate. If dataset already returns a list of batch data that generated in transforms, need to mer
monai/data/utils.py:455
↓ 18 callersMethodrandomize
(self, data: Any | None = None)
monai/transforms/spatial/dictionary.py:744
↓ 18 callersMethodset_random_state
(self, seed: int | None = None, state: np.random.RandomState | None = None)
monai/transforms/spatial/dictionary.py:1604
↓ 17 callersMethod__init__
( self, image_keys: KeysCollection, box_keys: KeysCollection, box_ref_image_ke
monai/apps/detection/transforms/dictionary.py:424
↓ 17 callersMethodadd_factory_class
Adds a factory function which returns the supplied class under the given name, with optional description.
monai/networks/layers/factories.py:100
↓ 17 callersMethodforward
(self, x)
tests/losses/test_generalized_wasserstein_dice_loss.py:167
↓ 17 callersFunctionseparable_filtering
Apply 1-D convolutions along each spatial dimension of `x`. Args: x: the input image. must have shape (batch, channels, H[, W, ...])
monai/networks/layers/simplelayers.py:207
↓ 17 callersMethodtrace_key
The key to store the stack of applied transforms.
monai/transforms/inverse.py:107
↓ 16 callersFunction_make_json_serializable
Convert a value to a JSON-serializable type. Handles numpy arrays, Path objects, torch tensors, and other common types.
monai/auto3dseg/utils.py:296
↓ 16 callersFunctionaffine_to_spacing
Computing the current spacing from the affine matrix. Args: affine: a d x d affine matrix. r: indexing based on the spatial
monai/data/utils.py:712
↓ 16 callersMethodapply
Applies the current model to a set of feature vectors. Args: features (torch.Tensor): feature vectors for each element.
monai/networks/layers/gmm.py:67
↓ 16 callersFunctioncreate_spherical_seg_3d
Return a 3D image with a sphere inside. Voxel values will be 1 inside the sphere, and 0 elsewhere. Args: radius: radius of spher
tests/metrics/test_surface_distance.py:25
↓ 16 callersFunctioncreate_spherical_seg_3d
Return a 3D image with a sphere inside. Voxel values will be 1 inside the sphere, and 0 elsewhere. Args: radius: radius of spher
tests/metrics/test_hausdorff_distance.py:28
↓ 16 callersFunctiondo_metric_reduction
This function is to do the metric reduction for calculated `not-nan` metrics of each sample's each class. The function also returns `not_nans
monai/metrics/utils.py:86
↓ 16 callersMethodinverse
(self, data)
tests/transforms/inverse/test_invertd.py:284
↓ 16 callersFunctionsplit_args
Split arguments in a way to be suitable for using with the factory types. If `args` is a string it's interpreted as the type name. Args:
monai/networks/layers/factories.py:163
↓ 16 callersMethodtrace_transform
Temporarily set the tracing status of a transform with a context manager.
monai/transforms/inverse.py:404
↓ 16 callersMethodtransforms
(key: str | None = None)
monai/utils/enums.py:392
↓ 16 callersFunctionverify_report_format
Compares the report and the report_format that has only keys. Args: report: dict that has real values. report_format: dict t
monai/auto3dseg/utils.py:271
↓ 15 callersMethod__init__
( self, to_pad: tuple[tuple[int, int]] | None = None, mode: str = PytorchPadMode.CONST
monai/transforms/croppad/array.py:109
↓ 15 callersMethod__init__
Args: keys: the key of expected data in the dict, the inverse of ``transforms`` will be applied on it in-place. I
monai/transforms/post/dictionary.py:801
↓ 15 callersMethodaggregate
Aggregate values for merging. This method is being called in a loop and should add values to their corresponding location in the merg
monai/inferers/merger.py:72
↓ 15 callersFunctiondownload_url_or_skip_test
``download_url`` and skip the tests if any downloading error occurs.
tests/test_utils.py:833
↓ 15 callersFunctionensure_tuple_size
Returns a copy of `tup` with `dim` values by either shortened or padded with `pad_val` as necessary.
monai/utils/misc.py:181
↓ 15 callersFunctionfirst
(iterable: Iterable[T], default: T)
monai/utils/misc.py:129
↓ 15 callersMethodget_data
(img_shape)
tests/transforms/test_fourier.py:36
↓ 15 callersMethodget_most_recent_transform
Get most recent matching transform for the current class from the sequence of applied operations. Args: data: dictionary
monai/transforms/inverse.py:344
↓ 15 callersMethodload_config_file
Load a single config file with specified file path (currently support JSON and YAML files). Args: filepath: path of targ
monai/bundle/config_parser.py:592
↓ 15 callersFunctionmake_nifti_image
Create a temporary nifti image on the disk and return the image name. User is responsible for deleting the temporary file when done with it.
tests/test_utils.py:387
↓ 15 callersMethodparse
Recursively resolve `self.config` to replace the macro tokens with target content. Then recursively parse the config source, add ever
monai/bundle/config_parser.py:459
↓ 15 callersMethodread
(self, name)
tests/transforms/test_load_image.py:48
↓ 15 callersMethodsample
Args: input_noise: random noise, of the same shape as the desired sample. diffusion_model: model to sample from.
monai/inferers/inferer.py:907
↓ 15 callersFunctiontqdm
(x)
monai/apps/pathology/metrics/lesion_froc.py:34
↓ 15 callersMethodupdate_ops
Register a statistical operation to the Analyzer and update the report_format. Args: key: value key in the report.
monai/auto3dseg/analyzer.py:77
↓ 14 callersFunction_maybe_new_metatensor
create a metatensor with fresh metadata if track_meta is True otherwise convert img into a torch tensor
monai/transforms/spatial/functional.py:98
↓ 14 callersFunctionadaptor
(function, outputs, inputs=None)
monai/transforms/adaptors.py:131
↓ 14 callersFunctioncreate_file_basename
Utility function to create the path to the output file based on the input filename (file name extension is not added by this function). W
monai/data/utils.py:984
↓ 14 callersFunctioncreate_rotate
create a 2D or 3D rotation matrix Args: spatial_dims: {``2``, ``3``} spatial rank radians: rotation radians when
monai/transforms/utils.py:862
↓ 14 callersFunctioncreate_translate
create a translation matrix Args: spatial_dims: spatial rank shift: translate pixel/voxel for every spatial dim, defaults to
monai/transforms/utils.py:1047
↓ 14 callersFunctionflip
Functional implementation of flip. This function operates eagerly or lazily according to ``lazy`` (default ``False``). Args:
monai/transforms/spatial/functional.py:275
↓ 14 callersFunctiongaussian_1d
one dimensional Gaussian kernel. Args: sigma: std of the kernel truncated: tail length approx: discrete Gaussian ker
monai/networks/layers/convutils.py:78
↓ 14 callersMethodget_transform_info
Return a dictionary with the relevant information pertaining to an applied transform.
monai/transforms/inverse.py:118
↓ 14 callersMethodinverse
(self, data)
monai/transforms/compose.py:391
↓ 14 callersMethodinverse
(self, data: Mapping[Hashable, torch.Tensor])
monai/transforms/spatial/dictionary.py:1558
↓ 14 callersFunctionversion_leq
Returns True if version `lhs` is earlier or equal to `rhs`. Args: lhs: version name to compare with `rhs`, return True if earlier or
monai/utils/module.py:538
↓ 13 callersMethod__init__
( self, spatial_dims: int, in_channels: int, prev_output_channel: int,
monai/networks/nets/diffusion_model_unet.py:943
↓ 13 callersMethod__init__
(self, name: str, *args, **kwargs)
monai/transforms/utility/array.py:1458
↓ 13 callersFunction_compiled_unsupported
Return True if ``monai._C`` (the compiled C extension providing ``grid_pull``) is not compiled with support for the given CUDA device's compu
monai/transforms/spatial/functional.py:57
↓ 13 callersMethodapply
(self, data: torch.Tensor)
monai/transforms/regularization/array.py:47
↓ 13 callersFunctionapply_transform
Transform `data` with `transform`. If `data` is a list or tuple and `map_data` is True, each item of `data` will be transformed and this
monai/transforms/transform.py:101
↓ 13 callersFunctioncopy_model_state
Compute a module state_dict, of which the keys are the same as `dst`. The values of `dst` are overwritten by the ones from `src` whenever the
monai/networks/utils.py:542
↓ 13 callersFunctioncreate_sim_data
Create simulated data using create_test_image_3d. Args: dataroot: data directory path that hosts the "nii.gz" image files. s
tests/apps/test_auto3dseg.py:89
↓ 13 callersMethodevaluate
For key-value pairs in the self.data, if the value is a callable, then this function will apply the callable to the input data.
monai/auto3dseg/operations.py:28
↓ 13 callersFunctionextractall
Extract file to the output directory. Expected file types are: `zip`, `tar.gz` and `tar`. Args: filepath: the file path of compr
monai/apps/utils.py:303
↓ 13 callersMethodforward
Forward pass through the UNet model. Args: x: Input tensor of shape (N, C, SpatialDims). timesteps: Timestep
monai/apps/generation/maisi/networks/diffusion_model_unet_maisi.py:368
↓ 13 callersMethodget_config
Get the config content of current config item.
monai/bundle/config_item.py:153
↓ 13 callersFunctionmoveaxis
`moveaxis` for pytorch and numpy
monai/transforms/utils_pytorch_numpy_unification.py:80
↓ 13 callersFunctionrescale_array
Rescale the values of numpy array `arr` to be from `minv` to `maxv`. If either `minv` or `maxv` is None, it returns `(a - min_a) / (max_a - m
monai/transforms/utils.py:232
↓ 13 callersMethodset_metadata
Resample ``self.data_obj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. Args: meta_dic
monai/data/image_writer.py:587
↓ 13 callersMethodset_timesteps
Sets the discrete timesteps used for the diffusion chain. Supporting function to be run before inference. Args: num_infe
monai/networks/schedulers/rectified_flow.py:207
↓ 13 callersFunctiontest_integration_value
(test_name, key, data, rtol=1e-2)
tests/testing_data/integration_answers.py:341
↓ 12 callersMethod__init__
(self, input_features: int, state_size: int)
monai/networks/layers/simplelayers.py:632
↓ 12 callersFunctiondatafold_read
Read a list of data dictionary `datalist` Args: datalist: the name of a JSON file listing the data, or a dictionary. basedir
monai/auto3dseg/utils.py:232
↓ 12 callersFunctiondownload_and_extract
Download file from URL and extract it to the output directory. Args: url: source URL link to download file. filepath: the fi
monai/apps/utils.py:381
↓ 12 callersMethodforward
Args: x: input tensor (N, C, SpatialDims). timesteps: timestep tensor (N,). seg: Bx[LABEL_NC]x[SPATIAL DI
monai/networks/nets/spade_diffusion_model_unet.py:895
↓ 12 callersFunctionget_conv_layer
( spatial_dims: int, in_channels: int, out_channels: int, kernel_size: Sequence[int] | int = 3
monai/networks/blocks/dynunet_block.py:270
↓ 12 callersMethodinverse
(self, data)
tests/integration/test_one_of.py:100
↓ 12 callersFunctionis_tf32_env
When we may be using TF32 mode, check the precision of matrix operation. If the checking result is greater than the threshold 0.001, set
tests/test_utils.py:227
↓ 12 callersFunctionresize
Functional implementation of resize. This function operates eagerly or lazily according to ``lazy`` (default ``False``). Args:
monai/transforms/spatial/functional.py:311
↓ 12 callersMethodset_data_array
Convert ``data_array`` into 'channel-last' numpy ndarray. Args: data_array: input data array with the channel dimension
monai/data/image_writer.py:566
↓ 12 callersFunctiontest_hard_clip_func
(im, lower, upper)
tests/transforms/test_clip_intensity_percentiles.py:25
↓ 12 callersFunctiontest_soft_clip_func
(im, lower, upper)
tests/transforms/test_clip_intensity_percentiles.py:36
↓ 12 callersMethodtrack_transform_meta
Update a stack of applied/pending transforms metadata of ``data``. Args: data: dictionary of data or `MetaTensor`.
monai/transforms/inverse.py:170
↓ 12 callersMethodwrite
Create a Nibabel object from ``self.create_backend_obj(self.obj, ...)`` and call ``nib.save``. Args: filename: filename
monai/data/image_writer.py:615
↓ 11 callersMethod__init__
( self, c_prev: int, c: int, rate: int, arch_code_c=None, spat
monai/networks/nets/dints.py:239
↓ 11 callersMethodaggregate
Execute reduction logic for the output of `_compute_tensor`. Args: reduction: define mode of reduction to the metrics, w
monai/metrics/calibration.py:314
↓ 11 callersFunctionapply_filter
Filtering `x` with `kernel` independently for each batch and channel respectively. Args: x: the input image, must have shape (batch,
monai/networks/layers/simplelayers.py:252
↓ 11 callersMethodcheck
( self, out: torch.Tensor, orig: torch.Tensor, *, shape: bool = True,
tests/data/meta_tensor/test_to_from_meta_tensord.py:63
↓ 11 callersMethodcrop_test_pending_ops
(self, input_param, input_shape, align_corners=False)
tests/croppers.py:109
↓ 11 callersFunctionevenly_divisible_all_gather
(data: torch.Tensor, concat: Literal[True])
monai/utils/dist.py:48
↓ 11 callersMethodforward
Args: x: input tensor (N, C, SpatialDims). timesteps: timestep tensor (N,). context: context tensor (N, 1
monai/networks/nets/diffusion_model_unet.py:1733
↓ 11 callersFunctionget_state_dict
Get the state dict of input object if has `state_dict`, otherwise, return object directly. For data parallel model, automatically convert it
monai/networks/utils.py:528
↓ 11 callersFunctionignore_background
(y_pred: NdarrayTensor, y: NdarrayTensor)
monai/metrics/utils.py:59
↓ 11 callersFunctionmake_shape_cases
( models, spatial_dims, batches, pretrained, in_channels=3, num_classes=10, input_
tests/networks/nets/test_flexible_unet.py:71
↓ 11 callersMethodsample
Args: input_noise: random noise, of the same shape as the desired latent representation. autoencoder_model: first sta
monai/inferers/inferer.py:1253
↓ 11 callersMethodstart
(self, engine)
monai/utils/profiling.py:426
↓ 10 callersMethod__init__
Args: data: input data to load and transform to generate dataset for model. transform: a callable, sequence of callab
monai/data/dataset.py:73
↓ 10 callersMethod__init__
Args: boundaries: list defining lower and upper boundaries for the signal drop, lower and upper values need to be pos
monai/transforms/signal/array.py:127
↓ 10 callersMethodcrop_test
(self, input_param, input_shape, expected_shape, same_area=None)
tests/croppers.py:31
↓ 10 callersMethodevaluate
Evaluate on client's local data. Args: data: `ExchangeObject` containing the current global model weights. e
monai/fl/client/monai_algo.py:626
↓ 10 callersFunctionpartition_dataset
Split the dataset into N partitions. It can support shuffle based on specified random seed. Will return a set of datasets, every dataset cont
monai/data/utils.py:1132
↓ 10 callersFunctionpath_to_uri
Convert a file path to URI. if not absolute path, will convert to absolute path first. Args: path: input file path to convert, can b
monai/utils/misc.py:719
↓ 10 callersMethodupdate
perform one iteration of the CG method. It takes the current solution x, the current search direction p, the current residual r, and
monai/networks/layers/conjugate_gradient.py:66
← previousnext →101–200 of 7,906, ranked by callers