def _validate_image_orientation(image_orientation):
row_cosine, column_cosine, slice_cosine = _extract_cosines(image_orientation)<EOL>if not _almost_zero(np.dot(row_cosine, column_cosine), <NUM_LIT>):<EOL><INDENT>raise DicomImportException("<STR_LIT>".format(row_cosine, column_cosine))<EOL><DEDENT>elif not _almost_zero(np.dot(row_cosine, column_cosine), <NUM_LIT>):<EOL><INDENT>logger.warning("<STR_LIT>".format(row_cosine, column_cosine))<EOL><DEDENT>if not _almost_one(np.linalg.norm(row_cosine), <NUM_LIT>):<EOL><INDENT>raise DicomImportException("<STR_LIT>".format(row_cosine))<EOL><DEDENT>elif not _almost_one(np.linalg.norm(row_cosine), <NUM_LIT>):<EOL><INDENT>logger.warning("<STR_LIT>".format(row_cosine))<EOL><DEDENT>if not _almost_one(np.linalg.norm(column_cosine), <NUM_LIT>):<EOL><INDENT>raise DicomImportException("<STR_LIT>".format(column_cosine))<EOL><DEDENT>elif not _almost_one(np.linalg.norm(column_cosine), <NUM_LIT>):<EOL><INDENT>logger.warning("<STR_LIT>".format(column_cosine))<EOL><DEDENT>
Ensure that the image orientation is supported
- The direction cosines have magnitudes of 1 (just in case)
- The direction cosines are perpendicular