AppendNDims ExtractNDims transforms