// Helper. Reads an AIM document from file using a version-specific native AIM methods. private static IAimDocumentInstance ReadAimDocumentFromDicomFile(IAimNativeHelper aimNativeHelper, string filePathName, string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid) { Platform.CheckForNullReference(aimNativeHelper, "aimNativeHelper"); Platform.CheckForEmptyString(filePathName, "filePathName"); if (aimNativeHelper is Aim3.Aim3NativeDcmHelper) { var aim3NativeHelper = (Aim3.Aim3NativeDcmHelper)aimNativeHelper; var annotations = aim3NativeHelper.ReadAnnotationsFromFile(filePathName); if (annotations != null) { return(new Aim3.Aim3DocumentInstance(annotations, studyInstanceUid, seriesInstanceUid, sopInstanceUid)); } } else if (aimNativeHelper is Aim4.Aim4NativeDcmHelper) { var aim4NativeHelper = (Aim4.Aim4NativeDcmHelper)aimNativeHelper; var annotations = aim4NativeHelper.ReadAnnotationsFromFile(filePathName); if (annotations != null) { return(new Aim4.Aim4DocumentInstance(annotations, studyInstanceUid, seriesInstanceUid, sopInstanceUid)); } } else { Debug.Assert(false, "Unexpected type of IAimNativeHelper"); } return(null); }
// Helper. Reads an AIM document from file using a version-specific native AIM methods. private static IAimDocumentInstance ReadAimDocumentFromDicomFile(IAimNativeHelper aimNativeHelper, string filePathName, string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid) { Platform.CheckForNullReference(aimNativeHelper, "aimNativeHelper"); Platform.CheckForEmptyString(filePathName, "filePathName"); if (aimNativeHelper is Aim3.Aim3NativeDcmHelper) { var aim3NativeHelper = (Aim3.Aim3NativeDcmHelper)aimNativeHelper; var annotations = aim3NativeHelper.ReadAnnotationsFromFile(filePathName); if (annotations != null) return new Aim3.Aim3DocumentInstance(annotations, studyInstanceUid, seriesInstanceUid, sopInstanceUid); } else if (aimNativeHelper is Aim4.Aim4NativeDcmHelper) { var aim4NativeHelper = (Aim4.Aim4NativeDcmHelper)aimNativeHelper; var annotations = aim4NativeHelper.ReadAnnotationsFromFile(filePathName); if (annotations != null) return new Aim4.Aim4DocumentInstance(annotations, studyInstanceUid, seriesInstanceUid, sopInstanceUid); } else { Debug.Assert(false, "Unexpected type of IAimNativeHelper"); } return null; }