-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into 6007-pil-reader
- Loading branch information
Showing
18 changed files
with
123 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright (c) MONAI Consortium | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" | ||
A collection of generic traits for MONAI transforms. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
__all__ = ["LazyTrait", "RandomizableTrait", "MultiSampleTrait", "ThreadUnsafe"] | ||
|
||
|
||
class LazyTrait: | ||
""" | ||
An interface to indicate that the transform has the capability to execute using | ||
MONAI's lazy resampling feature. In order to do this, the implementing class needs | ||
to be able to describe its operation as an affine matrix or grid with accompanying metadata. | ||
This interface can be extended from by people adapting transforms to the MONAI framework as | ||
well as by implementors of MONAI transforms. | ||
""" | ||
|
||
@property | ||
def lazy_evaluation(self): | ||
""" | ||
Get whether lazy_evaluation is enabled for this transform instance. | ||
Returns: | ||
True if the transform is operating in a lazy fashion, False if not. | ||
""" | ||
raise NotImplementedError() | ||
|
||
@lazy_evaluation.setter | ||
def lazy_evaluation(self, enabled: bool): | ||
""" | ||
Set whether lazy_evaluation is enabled for this transform instance. | ||
Args: | ||
enabled: True if the transform should operate in a lazy fashion, False if not. | ||
""" | ||
raise NotImplementedError() | ||
|
||
|
||
class RandomizableTrait: | ||
""" | ||
An interface to indicate that the transform has the capability to perform | ||
randomized transforms to the data that it is called upon. This interface | ||
can be extended from by people adapting transforms to the MONAI framework as well as by | ||
implementors of MONAI transforms. | ||
""" | ||
|
||
pass | ||
|
||
|
||
class MultiSampleTrait: | ||
""" | ||
An interface to indicate that the transform has the capability to return multiple samples | ||
given an input, such as when performing random crops of a sample. This interface can be | ||
extended from by people adapting transforms to the MONAI framework as well as by implementors | ||
of MONAI transforms. | ||
""" | ||
|
||
pass | ||
|
||
|
||
class ThreadUnsafe: | ||
""" | ||
A class to denote that the transform will mutate its member variables, | ||
when being applied. Transforms inheriting this class should be used | ||
cautiously in a multi-thread context. | ||
This type is typically used by :py:class:`monai.data.CacheDataset` and | ||
its extensions, where the transform cache is built with multiple threads. | ||
""" | ||
|
||
pass |
Oops, something went wrong.