### Diagnosis Element Example Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Demonstrates the usage of the element, including its text content, potential elements for diagnostic coding, and a element. The example shows a basic diagnosis and a more complex one with confirmation details and a coding system. ```XML text of diagnosis ``` ```XML At autopsy, was determined to have . 12345.67890 ``` -------------------------------- ### Linking an image to a PowerPoint presentation Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This example demonstrates how to use the anchor tag `` in conjunction with the element to create a link from an image to an external file, such as a PowerPoint presentation. ```xml ="JPEG ``` -------------------------------- ### Example Abstract with HTML Formatting Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Illustrates the structure of the element, showing how HTML

tags are used to define paragraphs. Nested HTML tags like for bold text are also demonstrated. ```xml content

First paragraph of the abstract.

Second paragraph of the abstract.

content ``` -------------------------------- ### Example XML with Level and Document Type Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This snippet demonstrates the usage of the and elements in an XML document, specifying the difficulty and type of a radiologic teaching file. ```xml intermediate radiologic teaching file ``` -------------------------------- ### Referencing an image with a hyperlink using and Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This example demonstrates how to use the element to create a hyperlink to an image file. It also shows how to specify the image format using the child element, which is crucial for discoverability in searches. ```xml jpeg image ``` -------------------------------- ### Displaying an image directly using and Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This example illustrates how to embed an image directly into a document using the element with the 'src' attribute. The child element specifies the image type. ```xml jpeg ``` -------------------------------- ### XMLRPC DPPublish Method for RIS Integration Source: https://github.com/horosproject/horosplugins/blob/master/DiscPublishing/html/index.html This snippet demonstrates the structure and parameters for the DPPublish XMLRPC method used to initiate the disc publishing process. It outlines the request parameters, expected response structure, and provides examples of how to call the method with different predicate syntax and tables. ```xml DPPublish table Study request accessionNumber = 'A0123456789' ``` ```javascript { request: "accessionNumber = 'A0123456789'", table: "Study" } ``` ```javascript { request: "patientID = '123456'", table: "Study" } ``` ```javascript { request: "study.patientID = '123456', seriesDICOMUID = '1.2.3.4.5.6.7'", table: "Series" } ``` ```url osirix://?methodName=DPPublish&table=Study&request="accessionNumber = 'A0123456789'" ``` -------------------------------- ### Example MIRC Document Structure with Author Information Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Demonstrates the structure of a MIRC document including the title and author elements. It shows how multiple authors and their contact details are represented. HTML is not permitted within these elements. ```xml This is the Title John Author Organization of John Author Email address of John Author Post address of John Author line 1 Post address of John Author line 2 Mary Author Organization of Mary Author Email address of Mary Author content ``` -------------------------------- ### OsiriX Plugin Development: PluginFilter Base Class Example Source: https://context7.com/horosproject/horosplugins/llms.txt Demonstrates the basic structure of an OsiriX plugin by subclassing the PluginFilter base class. It shows how to initialize the plugin and implement the main entry point for filtering images, accessing viewer controllers and image data. This is fundamental for creating custom functionalities within OsiriX. ```objc #import @interface MyPlugin : PluginFilter { } - (void) initPlugin; - (long) filterImage:(NSString*) menuName; @end @implementation MyPlugin - (void) initPlugin { // Called at OsiriX startup for initialization [PreferencesWindowController addPluginPaneWithResourceNamed:@"MyPreferences" inBundle:[NSBundle bundleForClass:[self class]] withTitle:@"My Plugin" image:[NSImage imageNamed:@"NSUser"]]; } - (long) filterImage:(NSString*) menuName { // Main plugin entry point when user selects from menu ViewerController *viewer = viewerController; // Inherited property NSArray *pixList = [viewer pixList]; NSLog(@"Plugin activated with %lu images", [pixList count]); return 0; // Return 0 for success } @end ``` -------------------------------- ### Complex element with patient and diagnosis metadata Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This comprehensive example showcases the element's ability to include extensive metadata about the patient, diagnosis, and image properties. It demonstrates how to associate clinical information with a specific image for detailed record-keeping. ```xml DICOM original CT abdomen renal carcinoma 86 male renal carcinoma pathology 1234.5678 JPEG ``` -------------------------------- ### Anchor (a) Element for Hyperlinks Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Illustrates the use of the element to create hyperlinks within a MIRC document. It includes the 'href' attribute for the link destination and the optional 'format' attribute to describe the linked document's format. The example shows linking to a PowerPoint presentation. ```HTML This is a reference to a resource. ``` -------------------------------- ### Embedding a JPEG image with a link to a DICOM image Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm This example shows a nested structure where a JPEG image is displayed directly, but it also acts as a hyperlink to a DICOM image. This allows for immediate viewing of a preview while providing access to a more detailed medical image. ```xml ``` -------------------------------- ### Displaying Medical Codes with RSNA MIRC Software Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Demonstrates how the element, along with its 'coding-system' attribute and optional element, is rendered by the RSNA MIRC software. It shows the default display format and an example with a meaning. ```xml 12345.67890 ``` ```xml 12345.67890 normal variant ``` -------------------------------- ### OsiriX Plugin Development: Image Iteration and DCMPix Access Source: https://context7.com/horosproject/horosplugins/llms.txt Provides an example of iterating through all images within a study, including multi-frame time series data common in dynamic medical imaging like cardiac CT. It demonstrates how to access DCMPix objects for each frame and extract essential DICOM metadata and pixel data, enabling detailed image processing. ```objc - (void) loopTroughImages { ViewerController *currentViewer = viewerController; // Loop through time frames (for dynamic studies like cardiac CT) for (long frame = 0; frame < [currentViewer maxMovieIndex]; frame++) { NSLog(@"Frame : %ld/%ld", frame+1, [currentViewer maxMovieIndex]); // Get all DCMPix objects for current frame NSArray *pixList = [currentViewer pixList:frame]; for (NSUInteger i = 0; i < [pixList count]; i++) { DCMPix *pix = [pixList objectAtIndex:i]; // Access DICOM metadata and pixel data float *imageData = [pix fImage]; long width = [pix pwidth]; long height = [pix pheight]; float pixelSpacingX = [pix pixelSpacingX]; float pixelSpacingY = [pix pixelSpacingY]; float sliceLocation = [pix sliceLocation]; NSLog(@"Image %lu: %ldx%ld, spacing=%.2f,%.2f, location=%.2f", i+1, width, height, pixelSpacingX, pixelSpacingY, sliceLocation); // Process pixel data (fImage is float array) for (long y = 0; y < height; y++) { for (long x = 0; x < width; x++) { long index = y * width + x; float pixelValue = imageData[index]; // Process pixel value... } } } } } ``` -------------------------------- ### Configure Xcode Build Settings for ITK/VTK Library Paths Source: https://github.com/horosproject/horosplugins/blob/master/_help/ITK plugins Help.txt This snippet shows how to configure the 'Library Search Paths' in Xcode's global build settings. It specifies the directories where the ITK and VTK libraries can be found, which is necessary for linking the plugin correctly. Two new entries are added for VTK and ITK libraries. ```text Binaries/VTKLibs ITK180/bin ``` -------------------------------- ### DPPublish Method - XMLRPC Source: https://github.com/horosproject/horosplugins/blob/master/DiscPublishing/html/index.html Initiates the disc publishing process by specifying database criteria through XMLRPC. ```APIDOC ## POST /RPC2 ### Description Initiates the disc publishing process by specifying what to publish through the `request` parameter. This method is part of the RIS integration via XMLRPC. ### Method POST ### Endpoint /RPC2 ### Parameters #### Request Body - **methodName** (string) - The name of the method to call, must be 'DPPublish'. - **params** (array) - An array containing the parameters for the method. For DPPublish, it should contain one struct. - **struct** (struct) - A structure containing the following keys: - **request** (string) - A string that respects NSPredicate syntax, used against the OsiriX database to filter which items to publish. - **table** (string) - The database entity the predicate is to be matched against. Must be one of 'Study', 'Series', or 'Image' (case-sensitive). ### Request Example ```xml DPPublish table Study request accessionNumber = 'A0123456789' ``` ### Response #### Success Response (200) - **result** (struct) - A struct containing the status of the publishing process. - **error** (integer) - An integer indicating the status. 0 means success. - **count** (integer) - The number of images being published (present only if error is 0). #### Error Response (e.g., 400, 500) - **result** (struct) - A struct containing error details. - **error** (integer) - An integer indicating the error code. - -1: 'request' or 'table' missing in request. - -2: An error occurred while fetching from the database. - -3: Database request returned 0 images. - -666: An exception occurred. - **localizedDescription** (string) - More details on the error (present only if error is -2). - **reason** (string) - Details of the exception (present only if error is -666). #### Response Example (Success) ```json { "error": 0, "count": 5 } ``` #### Response Example (Database Error) ```json { "error": -2, "localizedDescription": "Failed to fetch studies: Some details about the database error." } ``` #### Response Example (Exception) ```json { "error": -666, "reason": "An unexpected exception occurred during processing." } ``` ``` -------------------------------- ### Create DICOMDIR Files in Objective-C Source: https://context7.com/horosproject/horosplugins/llms.txt This Objective-C method generates a DICOMDIR index file for a selected folder containing DICOM files. It prompts the user to choose a directory, enumerates through its contents, adds each DICOM file to a DCMDirectory object, and finally writes the DICOMDIR file to the selected folder. It utilizes NSOpenPanel for directory selection and DCMDirectory for DICOM file indexing. ```objc - (long) createDICOMDIR { // Present folder selection dialog NSOpenPanel *openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseDirectories:YES]; [openPanel setAllowsMultipleSelection:NO]; [openPanel setTitle:@"Select DICOM Folder"]; [openPanel setMessage:@"Choose folder containing DICOM files"]; if ([openPanel runModal] == NSOKButton) { NSString *folder = [openPanel filename]; // Create DICOMDIR object DCMDirectory *directory = [DCMDirectory directory]; // Enumerate all files in directory NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:folder]; NSString *file; while (file = [enumerator nextObject]) { NSString *fullPath = [folder stringByAppendingPathComponent:file]; // Add each file to DICOMDIR structure NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @try { [directory addObjectAtPath:fullPath]; NSLog(@"Added to DICOMDIR: %@", file); } @catch (NSException *exception) { NSLog(@"Failed to add file %@: %@", file, [exception reason]); } [pool release]; } // Write DICOMDIR file NSString *dicomdirPath = [folder stringByAppendingPathComponent:@"DICOMDIR"]; BOOL success = [directory writeToFile:dicomdirPath]; if (success) { NSRunInformationalAlertPanel(@"Success", [NSString stringWithFormat:@"DICOMDIR created at:\n%@", dicomdirPath], @"OK", nil, nil); } else { NSRunAlertPanel(@"Error", @"Failed to create DICOMDIR file", @"OK", nil, nil); } } return 0; } ``` -------------------------------- ### Configure Xcode Build Settings for ITK/VTK Headers Source: https://github.com/horosproject/horosplugins/blob/master/_help/ITK plugins Help.txt This snippet illustrates the compiler directives needed in Xcode's Build Settings (under Build Options) for files using ITK or VTK headers. It ensures the build system can locate the necessary ITK and VTK header files. This is crucial for avoiding global header inclusions. ```text -I ./ITK180 -I ./ITK180/Code -I ./ITK180/Code/Algorithms -I ./ITK180/Code/BasicFilters -I ./ITK180/Code/Common -I ./ITK180/Code/Numerics -I ./ITK180/Code/IO -I ./ITK180/Code/Numerics/FEM -I ./ITK180/Code/Numerics/Statistics -I ./ITK180/Code/SpatialObject -I ./ITK180/Code/Utilities/MetaIO -I ./ITK180/Code/Utilities/expat -I ./ITK180/Code/Utilities/NrrdIO -I ./ITK180/Code/Utilities/DICOMParser -I ./ITK180/Utilities -I ./ITK180/Utilities/vxl/vcl -I ./ITK180/Utilities/vxl/core -I ./VTKHeaders ``` -------------------------------- ### Image Compression History Enumerated Values Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Defines the possible states of an image's compression history. These values indicate the highest level of compression applied, with lower levels being implied. For example, 'reversible' implies the image is not simply a non-reversibly compressed version of another image. ```xml original reversible non-reversible unknown ``` -------------------------------- ### Duplicate Viewer Window for Comparison - Objective-C Source: https://context7.com/horosproject/horosplugins/llms.txt Creates a new viewer window with a duplicate of the current series. This is useful for comparing original and processed images or for batch processing. It accesses pixel data from both viewers, modifies the duplicated images (e.g., inversion), and updates the display with a custom title. ```objc - (ViewerController*) createDuplicateViewer { // Duplicate the current 2D viewer window ViewerController *newViewer = [self duplicateCurrent2DViewerWindow]; // Get pixel data from both viewers NSArray *originalPixList = [viewerController pixList]; NSArray *newPixList = [newViewer pixList]; // Modify duplicated images for (NSUInteger i = 0; i < [newPixList count]; i++) { DCMPix *originalPix = [originalPixList objectAtIndex:i]; DCMPix *newPix = [newPixList objectAtIndex:i]; float *originalData = [originalPix fImage]; float *newData = [newPix fImage]; long pixelCount = [newPix pwidth] * [newPix pheight]; // Apply custom processing (e.g., inversion) for (long j = 0; j < pixelCount; j++) { newData[j] = -originalData[j]; } // Update window/level for display [newPix computeROI:nil :nil :nil :nil :nil :nil]; } // Update the new viewer display [newViewer needsDisplayUpdate]; // Set custom title [[newViewer window] setTitle:@"Processed Images"]; return newViewer; } ``` -------------------------------- ### Create and Compute ROI Statistics Source: https://context7.com/horosproject/horosplugins/llms.txt This Objective-C method demonstrates how to create a new closed polygon ROI, add points to define its shape, compute statistics (mean, total, standard deviation, min, max) for the pixels within the ROI, retrieve pixel values, modify pixels inside the ROI, and update the viewer's display. It uses the DCMView and DCMPix classes for image and ROI handling. ```objc - (long) createROI { // Get current image and ROI lists DCMPix *curPix = [[viewerController pixList] objectAtIndex:[[viewerController imageView] curImage]]; NSMutableArray *roiSeriesList = [viewerController roiList]; NSMutableArray *roiImageList = [roiSeriesList objectAtIndex:[[viewerController imageView] curImage]]; // Create new closed polygon ROI (see DCMView.h for available types) // Available types: tCPolygon, tOPolygon, tROI, tOval, tMesure, tAngle, t2DPoint, tText, etc. ROI *newROI = [viewerController newROI:tCPolygon]; // Add points to ROI (coordinates in pixels) NSMutableArray *points = [newROI points]; [points addObject:[viewerController newPoint:20 :20]]; [points addObject:[viewerController newPoint:20 :50]]; [points addObject:[viewerController newPoint:50 :50]]; [points addObject:[viewerController newPoint:50 :20]]; // Select the ROI for user interaction [newROI setROIMode:ROI_selected]; // Add to image's ROI list [roiImageList addObject:newROI]; // Compute statistics: mean, total, standard deviation, min, max float rmean, rtotal, rdev, rmin, rmax; [curPix computeROI:newROI :&rmean :&rtotal :&rdev :&rmin :&rmax]; // Get all pixel values within ROI long noOfValues; float *pixelValues = [curPix getROIValue:&noOfValues :newROI :0L]; NSLog(@"ROI contains %ld pixels", noOfValues); for (long i = 0; i < noOfValues; i++) { // Process individual pixel values float value = pixelValues[i]; } free(pixelValues); // Modify pixels inside ROI (fill with specific value range) [curPix fillROI:newROI :1 :-99999 :99999 :NO]; // Update display [viewerController needsDisplayUpdate]; // Display results NSRunInformationalAlertPanel (@"ROI Created", [NSString stringWithFormat:@"Mean: %.2f\nTotal: %.2f\nDev: %.2f\nMin: %.2f\nMax: %.2f", rmean, rtotal, rdev, rmin, rmax], @"OK", nil, nil); return 0; } ``` -------------------------------- ### MIRCdocument Display Attribute Options Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Demonstrates the usage of the 'display' attribute within the MIRCdocument element. This attribute dictates how the MIRC rendering software should present the document content, supporting 'page' (linear), 'tab' (tabbed sections), and 'mstf' (standardized teaching file format) modes. ```xml ``` -------------------------------- ### RSNA MIRC Image Display Command Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm The element is a command for RSNA MIRC software to display a specific image. It supports 'image' or 'annotation' attributes, referencing an or element respectively. Ignored in page and tab display modes. ```XML ``` -------------------------------- ### MIRCdocument Element Structure with Docref Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Illustrates the basic structure of a MIRCdocument element, emphasizing the required 'docref' attribute which must contain a fully qualified URL to the document. This URL is crucial for the Storage Service to provide valid references in MIRCqueryresult replies. ```xml title, author, abstract content additional elements one for each match ``` -------------------------------- ### Export ROI Data to CSV using Objective-C Source: https://context7.com/horosproject/horosplugins/llms.txt This Objective-C method exports Regions of Interest (ROIs) to a CSV file. It iterates through images and their ROIs, computes statistics (mean, min, max, etc.), converts pixel coordinates to DICOM coordinates, and extracts measurements like area and length. The output CSV includes image and ROI identifiers, statistics, names, center coordinates, dimensions, type, and point data. It relies on viewerController and ROI objects for data retrieval and computation. ```objc - (void) exportROIsToCSV:(NSString*)filePath { NSArray *pixList = [viewerController pixList]; NSArray *roiSeriesList = [viewerController roiList]; // Create CSV header NSMutableString *csvText = [NSMutableString stringWithCapacity:100]; [csvText appendFormat:@"ImageNo,RoiNo,RoiMean,RoiMin,RoiMax,RoiTotal,RoiDev,RoiName,RoiCenterX,RoiCenterY,RoiCenterZ,Length,Area,RoiType,NumOfPoints,mmX,mmY,mmZ,pxX,pxY\n"]; // Iterate through all images for (NSUInteger i = 0; i < [roiSeriesList count]; i++) { DCMPix *pix = [pixList objectAtIndex:i]; NSArray *roiImageList = [roiSeriesList objectAtIndex:i]; // Process each ROI in current image for (NSUInteger j = 0; j < [roiImageList count]; j++) { ROI *roi = [roiImageList objectAtIndex:j]; NSString *roiName = [roi name]; // Compute ROI statistics float mean = 0, min = 0, max = 0, total = 0, dev = 0; [pix computeROI:roi :&mean :&total :&dev :&min :&max]; // Get ROI center in DICOM coordinates NSPoint roiCenterPoint = [roi centroid]; float dicomCoords[3]; [pix convertPixX:roiCenterPoint.x pixY:roiCenterPoint.y toDICOMCoords:dicomCoords]; // Extract area and length measurements float area = 0, length = 0; NSMutableDictionary *dataString = [roi dataString]; if ([dataString objectForKey:@"AreaCM2"]) area = [[dataString objectForKey:@"AreaCM2"] floatValue]; if ([dataString objectForKey:@"Length"]) length = [[dataString objectForKey:@"Length"] floatValue]; // Process ROI points NSMutableArray *roiPoints = [roi points]; NSMutableString *pointsData = [NSMutableString string]; for (NSUInteger k = 0; k < [roiPoints count]; k++) { MyPoint *mypt = [roiPoints objectAtIndex:k]; NSPoint pt = [mypt point]; // Convert to DICOM coordinates float pointCoords[3]; [pix convertPixX:pt.x pixY:pt.y toDICOMCoords:pointCoords]; if (k > 0) [pointsData appendString:@","]; [pointsData appendFormat:@"%.2f,%.2f,%.2f,%.2f,%.2f", pointCoords[0], pointCoords[1], pointCoords[2], pt.x, pt.y]; } // Write CSV row [csvText appendFormat:@"%lu,%lu,%.2f,%.2f,%.2f,%.2f,%.2f,%@,%.2f,%.2f,%.2f,%.2f,%.2f,%ld,%lu,%@\n", i, j, mean, min, max, total, dev, roiName, dicomCoords[0], dicomCoords[1], dicomCoords[2], length, area, [roi type], [roiPoints count], pointsData]; } } // Save to file [csvText writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; } ``` -------------------------------- ### Display Progress Dialog for Long Operations - Objective-C Source: https://context7.com/horosproject/horosplugins/llms.txt Implements a progress dialog to indicate the status of long-running operations. It shows a progress window, processes each image in a series while updating the progress bar, and then closes the dialog. This provides user feedback during intensive computations. ```objc - (void) performLongOperation { // Create progress window Wait *splash = [[Wait alloc] initWithString:@"Processing images..."]; [splash showWindow:viewerController]; NSArray *pixList = [viewerController pixList]; [[splash progress] setMaxValue:[pixList count]]; // Process each image with progress updates for (NSUInteger i = 0; i < [pixList count]; i++) { DCMPix *pix = [pixList objectAtIndex:i]; // Perform time-consuming operation float *imageData = [pix fImage]; long pixelCount = [pix pwidth] * [pix pheight]; for (long j = 0; j < pixelCount; j++) { // Complex processing... imageData[j] = imageData[j] * 1.5; } // Update progress bar [[splash progress] incrementBy:1.0]; } // Close progress window [splash close]; [splash release]; // Update viewer [viewerController needsDisplayUpdate]; } ``` -------------------------------- ### Handle Mouse Down Events in Objective-C Source: https://context7.com/horosproject/horosplugins/llms.txt This Objective-C method captures left mouse button down events within a viewer. It converts window coordinates to OpenGL coordinates, logs the click position, and adds a custom ROI layer at the clicked location. It requires ViewerController and related ROI classes. ```objc - (BOOL) handleEvent:(NSEvent*)event forViewer:(ViewerController*)c { if (![c isKindOfClass:[ViewerController class]]) return NO; if ([event type] == NSLeftMouseDown) { // Convert mouse coordinates from window to OpenGL view coordinates NSPoint windowPoint = [[c imageView] convertPoint:[event locationInWindow] fromView:nil]; NSPoint glPoint = [[c imageView] ConvertFromNSView2GL:windowPoint]; NSLog(@"Mouse clicked at: x=%.2f, y=%.2f", glPoint.x, glPoint.y); // Add custom layer ROI at click position NSImage *image = [[NSImage alloc] initWithContentsOfFile: [[NSBundle bundleForClass:[self class]] pathForResource:@"marker" ofType:@"png"]]; float pixSpacing = (1.0 / 72 * 25.4); // Convert 72 dpi to millimeters ROI *newLayer = [c addLayerRoiToCurrentSliceWithImage:image referenceFilePath:nil layerPixelSpacingX:pixSpacing layerPixelSpacingY:pixSpacing]; [c bringToFrontROI:newLayer]; [newLayer generateEncodedLayerImage]; // Calculate center offset and position the layer NSPoint imageCenter = NSMakePoint([image size].width/2, [image size].height/2); NSArray *layerPoints = [newLayer points]; NSPoint layerSize = [[layerPoints objectAtIndex:2] point] - [[layerPoints objectAtIndex:0] point]; NSPoint layerCenter = NSMakePoint(layerSize.x * 0.5, layerSize.y * 0.5); [[newLayer points] addObject:[MyPoint point:layerCenter]]; [newLayer setROIMode:ROI_selected]; [newLayer roiMove:NSMakePoint(glPoint.x - layerCenter.x, glPoint.y - layerCenter.y) :YES]; [image release]; return YES; // Event handled } return NO; // Event not handled } ``` -------------------------------- ### Representing Patient Information in XML Source: https://github.com/horosproject/horosplugins/blob/master/MIRC Teaching File/TheMIRCdocumentSchema.htm Illustrates the structure of the element, including its attributes and various child elements for demographic and medical information. This includes patient name, ID, age, sex, race, and potentially diagnostic and other coding systems. ```xml 3 male ``` ```xml John Doe; 7654321; 3 ; male; caucasian text of diagnosis biopsy 12345.67890 diagnosis code meaning a.b.cde.fgh alpha.beta ```