Skip to content
aditiiyer edited this page Sep 25, 2019 · 4 revisions

Altering scan display through the Viewer

  • The scan set to be displayed can be selected from CERR's menu bar located at the top .
  • Scan display can be turned off by de-selecting View -> Scan
  • Scan sets displayed on individual panels can be changed by right-clicking the panel and then selecting the desired scan set.
  • Scan transparency can be adjusted by moving the scan/dose slider located on the left side of the Viewer.
  • The scan management window (Scan -> Scan Management) can be used to delete scans from planC.

Editing scans programmatically **

Scans are stored in the planC cell array and can be accessed as follows:

>> scanNum = 1;
>> planC{indexS.scan}(scanNum)
ans = 
          scanArray: [256x256x68 uint16]
            scanType: 'CT'
           scanInfo: [1x68 struct]
    uniformScanInfo: [1x1 struct]
  scanArraySuperior: [256x256x28 uint16]
  scanArrayInferior: [256x256x47 uint16]
         thumbnails: [1x1 struct]
             transM: []
            scanUID: 'CT.3172006.10934.02534.079'

Notice that the fieldnames are similar to ones used in RTOG specification. Some of the important fields are: '.scanArray' - stores the volumetric scan data,
'.transM' - stores the 4x4 rigid-transformation matrix,
'.scanUID' - stores the unique identifier for this scan. Note that this fields gets modified (or should be modified) whenever user changes any data associated with this scan.
'.scanInfo' - is a structure array which stores the information for each slice. For example, the 1st information for 1st slice can be obtained as follows:

>> sliceNum = 1;
>> planC{indexS.scan}(scanNum).scanInfo(sliceNum)
ans = 
           imageNumber: 1
             imageType: 'CT Scan'
            caseNumber: 'orart1_hn'
           patientName: 'orart1_hn'
              scanType: 'TRANSVERSE'
              CTOffset: 1024
            grid1Units: 0.2000
            grid2Units: 0.2000
  numberRepresentation: 'TWO'S COMPLEMENT INTEGER'
         bytesPerPixel: 2
    numberOfDimensions: 2
      sizeOfDimension1: 256
      sizeOfDimension2: 256
                zValue: 0.1000
               xOffset: 25.6000
               yOffset: 25.6000
                 CTAir: 0
               CTWater: 1024
        sliceThickness: 0.3500
        siteOfInterest: 
            unitNumber: 
       scanDescription: 
           scannerType: 'Picker International, Inc. PQ2000'
          scanFileName: 
             headInOut: 'IN'
        positionInScan: 'NOSE UP'
       patientAttitude: 
          tapeOfOrigin: 
   studyNumberOfOrigin: 'orart1_hn'
                scanID: 
            scanNumber: 
              scanDate: 
               CTScale: 
         distrustAbove: 
           imageSource: 
            bookmarked: 0
      transferProtocol: 
          DICOMHeaders:

The coordinates of the scan grid can be obtained by using the getScanXYZVals CERR function as follows:

>> [xScanVals, yScanVals, zScanVals] = getScanXYZVals(planC{indexS.scan}(scanNum))

Extracting a 3D scan array**

global planC
indexS = planC{end};
scan3M  = double(getScanArray(scanNum,planC));  
CToffset = planC{indexS.scan}(scanNum).scanInfo(1).CTOffset;
scan3M = scan3M - CTOffset;
Clone this wiki locally