-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MONAI Data Shape Assumption
Nic Ma edited this page Mar 15, 2020
·
1 revision
we agree on some assumptions on the form of input data to the components, so that we save the efforts on user input validation, and make it easier to ensure the overall software quality.
These apply to loss, metrics, transform (preprocessors), network modules:
- all non-transform components assume input data shape [batch x channel x spatial_dims]
- transforms (except loader) assume input data shape [channel x spatial_dims]
- spatial_dims could be 0D 1D 2D 3D - 0D for [batch x channel] for classification labels
- for 4D to ND cases, new axes are appended after the spatial_dims, each component can choose to support them or not.
- [batch x spatial_dims] is not allowed, and should be explicitly converted into [Batch x 1 x spatial_dims] when loading
- [spatial_dims] is not allowed in transform, should be converted into [1 x spatial_dims] when loading