In many applications, knowledge of the pixel-index bounds of an NDF may be unnecessary and it is sufficient to know the dimension sizes (i.e. how many pixels there are along each dimension). This will normally be the case when converting an application that was originally written for a different data system, where typically the dimension size is the only shape information used.
The dimension size D is related to the lower and upper bounds of each dimension, L and U, by:
but may be obtained more directly using the routine NDF_DIM, as follows:
INTEGER NDIMX, DIM( NDIMX ), NDIM
...
CALL NDF_DIM( INDF, NDIMX, DIM, NDIM, STATUS )
As with NDF_BOUND, an integer array DIM is provided to receive the returned dimension sizes, and any unused elements in this array will be assigned the value 1. If the array size NDIMX is less than the actual number of NDF dimensions, then information for extra non-significant dimensions (i.e. dimensions with sizes equal to 1) will be discarded. However, if any of the discarded dimensions would be significant (i.e. have a size greater than 1), then an error will result.
This again allows an application to make an NDF appear to have the number of dimensions it requires if at all possible. For instance, a smoothing application might expect an NDF to contain a 2-dimensional image, and could obtain the dimension sizes it requires, NX and NY, as follows:
INTEGER DIM( 2 ), NDIM, NX, NY
...
CALL NDF_DIM( INDF, 2, DIM, NDIM, STATUS )
NX = DIM( 1 )
NY = DIM( 2 )
...
No explicit check on the number of NDF dimensions would be necessary.