### Patient Setup Information Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Details related to patient setup and positioning. ```APIDOC ## Patient Setup Information ### Description This section describes the attributes related to patient setup, including patient positioning, fixation devices, and setup techniques. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **PatientSetupSequence** (SQ) - Required - Sequence of patient setup information. - **PatientSetupNumber** (IS) - Required - Sequential number for the patient setup. - **PatientSetupLabel** (LO) - Optional - Label for the patient setup. - **PatientAdditionalPosition** (LO) - Optional - Additional positioning information for the patient. - **FixationDeviceSequence** (SQ) - Optional - Sequence of fixation devices. - **FixationDeviceType** (CS) - Type of fixation device. - **FixationDeviceLabel** (SH) - Label for the fixation device. - **FixationDeviceDescription** (ST) - Description of the fixation device. - **FixationDevicePosition** (SH) - Position of the fixation device. - **FixationDevicePitchAngle** (FL) - Pitch angle of the fixation device. - **FixationDeviceRollAngle** (FL) - Roll angle of the fixation device. - **ShieldingDeviceSequence** (SQ) - Optional - Sequence of shielding devices. - **ShieldingDeviceType** (CS) - Type of shielding device. - **ShieldingDeviceLabel** (SH) - Label for the shielding device. - **ShieldingDeviceDescription** (ST) - Description of the shielding device. - **ShieldingDevicePosition** (SH) - Position of the shielding device. - **SetupTechnique** (CS) - Technique used for patient setup. - **SetupTechniqueDescription** (ST) - Description of the setup technique. - **SetupDeviceSequence** (SQ) - Optional - Sequence of setup devices. - **SetupDeviceType** (CS) - Type of setup device. - **SetupDeviceLabel** (SH) - Label for the setup device. - **SetupDeviceDescription** (ST) - Description of the setup device. - **SetupDeviceParameter** (DS) - Parameter for the setup device. - **SetupReferenceDescription** (ST) - Description of the setup reference. - **TableTopVerticalSetupDisplacement** (DS) - Vertical displacement of the table top during setup. - **TableTopLongitudinalSetupDisplacement** (DS) - Longitudinal displacement of the table top during setup. ### Request Example ```json { "PatientSetupSequence": [ { "PatientSetupNumber": 1, "PatientSetupLabel": "Initial Setup", "FixationDeviceSequence": [ { "FixationDeviceType": "HEADREST", "FixationDeviceLabel": "HR-01" } ], "SetupTechnique": "IMAGING" } ], "TableTopVerticalSetupDisplacement": 0.5 } ``` ### Response #### Success Response (200) - **PatientSetupSequence** (SQ) - Sequence of patient setup information. - **PatientSetupNumber** (IS) - Sequential number for the patient setup. - **PatientSetupLabel** (LO) - Label for the patient setup. - **PatientAdditionalPosition** (LO) - Additional positioning information for the patient. - **FixationDeviceSequence** (SQ) - Sequence of fixation devices. - **FixationDeviceType** (CS) - Type of fixation device. - **FixationDeviceLabel** (SH) - Label for the fixation device. - **FixationDeviceDescription** (ST) - Description of the fixation device. - **FixationDevicePosition** (SH) - Position of the fixation device. - **FixationDevicePitchAngle** (FL) - Pitch angle of the fixation device. - **FixationDeviceRollAngle** (FL) - Roll angle of the fixation device. - **ShieldingDeviceSequence** (SQ) - Sequence of shielding devices. - **ShieldingDeviceType** (CS) - Type of shielding device. - **ShieldingDeviceLabel** (SH) - Label for the shielding device. - **ShieldingDeviceDescription** (ST) - Description of the shielding device. - **ShieldingDevicePosition** (SH) - Position of the shielding device. - **SetupTechnique** (CS) - Technique used for patient setup. - **SetupTechniqueDescription** (ST) - Description of the setup technique. - **SetupDeviceSequence** (SQ) - Sequence of setup devices. - **SetupDeviceType** (CS) - Type of setup device. - **SetupDeviceLabel** (SH) - Label for the setup device. - **SetupDeviceDescription** (ST) - Description of the setup device. - **SetupDeviceParameter** (DS) - Parameter for the setup device. - **SetupReferenceDescription** (ST) - Description of the setup reference. - **TableTopVerticalSetupDisplacement** (DS) - Vertical displacement of the table top during setup. - **TableTopLongitudinalSetupDisplacement** (DS) - Longitudinal displacement of the table top during setup. #### Response Example ```json { "PatientSetupSequence": [ { "PatientSetupNumber": 1, "PatientSetupLabel": "Initial Setup", "FixationDeviceSequence": [ { "FixationDeviceType": "HEADREST", "FixationDeviceLabel": "HR-01" } ], "SetupTechnique": "IMAGING" } ], "TableTopVerticalSetupDisplacement": 0.5 } ``` ``` -------------------------------- ### Initialize SPM and Modalities Source: https://context7.com/spm/spm12/llms.txt This function initializes SPM, displays the welcome screen, and launches specific modality interfaces (PET, fMRI, EEG). It also provides utilities for setting defaults, retrieving version information, installation directory, current time, checking command-line mode, and displaying alerts. ```matlab spm spm fmri spm('fmri') spm pet spm('pet') spm eeg spm('eeg') spm('defaults', 'FMRI') [version, release] = spm('Ver'); disp(['SPM Version: ' version ' (Release ' release ')']) spm_dir = spm('Dir') time_str = spm('time') is_cmdline = spm('CmdLine') spm('alert!', 'This is a warning message', 'Warning Title') ``` -------------------------------- ### GET /dicom/tags/procedure-steps Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Retrieves the definitions for Scheduled and Performed Procedure Step attributes. ```APIDOC ## GET /dicom/tags/procedure-steps ### Description Returns the list of DICOM tags related to procedure steps, including scheduling details, station information, and procedure status. ### Method GET ### Endpoint /dicom/tags/procedure-steps ### Parameters None ### Response #### Success Response (200) - **ScheduledProcedureStepID** (SH) - Identifier for the scheduled procedure step. - **PerformedProcedureStepStatus** (CS) - Current status of the performed procedure step. - **ScheduledPerformingPhysicianName** (PN) - Name of the scheduled performing physician. #### Response Example { "(0040,0009)": "ScheduledProcedureStepID", "(0040,0252)": "PerformedProcedureStepStatus" } ``` -------------------------------- ### GET /brachytherapy/treatment-data Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Retrieves the structured sequence data for Brachytherapy treatment planning, including source, channel, and applicator configurations. ```APIDOC ## GET /brachytherapy/treatment-data ### Description Retrieves the comprehensive list of Brachytherapy treatment parameters, including source characteristics, channel sequences, and applicator specifications. ### Method GET ### Endpoint /brachytherapy/treatment-data ### Parameters #### Query Parameters - **studyInstanceUID** (string) - Required - The unique identifier for the study. ### Request Example GET /brachytherapy/treatment-data?studyInstanceUID=1.2.840.113619.2.55.3.2831152205.894 ### Response #### Success Response (200) - **SourceSequence** (array) - List of radioactive sources used in treatment. - **ChannelSequence** (array) - Configuration of channels and dwell positions. - **ApplicationSetupSequence** (array) - Details regarding the application setup. #### Response Example { "SourceSequence": [ { "SourceNumber": 1, "SourceType": "ISOTOPE", "SourceIsotopeName": "Ir-192" } ], "ChannelSequence": [ { "ChannelNumber": 1, "ChannelLength": 150.5 } ] } ``` -------------------------------- ### Convert DICOM to NIfTI with spm_dicom_convert Source: https://context7.com/spm/spm12/llms.txt Demonstrates how to read DICOM headers and convert raw scanner data into NIfTI format. Supports various output structures including flat directories, patient ID organization, and BIDS-style metadata. ```matlab % Read DICOM headers dicom_files = spm_select('FPList', '/scanner/data/', '.*\.dcm$'); headers = spm_dicom_headers(dicom_files); disp(['Found ' num2str(numel(headers)) ' DICOM files']); % Basic conversion out = spm_dicom_convert(headers); % Convert with organization by patient ID out = spm_dicom_convert(headers, 'all', 'patid', 'nii', '/output/'); % Convert with JSON sidecar metadata out = spm_dicom_convert(headers, 'all', 'patid_date', 'nii', pwd, true); ``` -------------------------------- ### GET /dicom/tags/waveform Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Retrieves the definitions for Waveform Presentation Group Sequence attributes. ```APIDOC ## GET /dicom/tags/waveform ### Description Returns the list of DICOM tags associated with Waveform Presentation Group sequences, including display scales and channel identification. ### Method GET ### Endpoint /dicom/tags/waveform ### Parameters None ### Response #### Success Response (200) - **WaveformPresentationGroupSequence** (SQ) - Sequence of waveform presentation groups. - **PresentationGroupNumber** (US) - Identifier for the presentation group. - **ChannelDisplaySequence** (SQ) - Sequence defining channel display properties. #### Response Example { "(003A,0240)": "WaveformPresentationGroupSequence", "(003A,0241)": "PresentationGroupNumber" } ``` -------------------------------- ### Calibration Settings Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Information regarding calibration procedures and settings. ```APIDOC ## Calibration Settings Sequence ### Description Sequence containing details about calibration procedures. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **CalibrationSettingsSequence** (SQ) - Sequence of calibration settings. - **CalibrationProcedure** (ST) - Description of the calibration procedure. - **ProcedureVersion** (SH) - Version of the calibration procedure. - **ProcedureCreationDate** (DA) - Date the procedure was created. - **ProcedureExpirationDate** (DA) - Expiration date of the procedure. - **ProcedureLastModifiedDate** (DA) - Date the procedure was last modified. - **CalibrationTime** (TM) - Time of calibration. - **CalibrationDate** (DA) - Date of calibration. #### Response Example N/A ``` -------------------------------- ### SPM12 Function Documentation Template Source: https://github.com/spm/spm12/blob/main/spm_FcnTpl.txt A template for documenting MATLAB functions in the SPM12 environment, including parameter and return value specifications. ```APIDOC ## FUNCTION spm_FCN ### Description This template defines the standard documentation format for SPM12 functions, including H1 line descriptions, input/output parameter definitions, and detailed help text. ### Method MATLAB Function Call ### Parameters #### Input Parameters - **P1** (any) - Required - Description of the input parameter, including expected ranges or types. #### Return Values - **R1** (any) - Required - Description of the returned values. ### Usage Example [R1] = spm_FCN(P1); ### Notes - All functions should include a copyright notice and author information. - Use the provided banner and section heading styles for code organization. ``` -------------------------------- ### GET /dicom/spm12/attributes Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Retrieves the list of DICOM attributes defined under the SPM12 project, including metadata fields for findings, observations, and document identifiers. ```APIDOC ## GET /dicom/spm12/attributes ### Description Retrieves a list of DICOM attributes associated with the SPM12 project, providing details on tag IDs, names, value representations (VR), and retirement status. ### Method GET ### Endpoint /dicom/spm12/attributes ### Parameters #### Query Parameters - **tag** (string) - Optional - Filter by specific DICOM tag ID (e.g., 0040,A040) ### Response #### Success Response (200) - **tag_id** (string) - The DICOM tag identifier - **name** (string) - The descriptive name of the attribute - **vr** (string) - Value Representation (e.g., SQ, CS, DT) - **retired** (boolean) - Indicates if the attribute is retired #### Response Example { "tag_id": "(0040,A040)", "name": "Value Type", "vr": "CS", "retired": false } ``` -------------------------------- ### SPM Unified Segmentation Source: https://context7.com/spm/spm12/llms.txt Segments structural images into tissue classes (gray matter, white matter, CSF) while estimating spatial normalization parameters and bias field correction. Requires SPM installation and T1 structural image as input. ```matlab % Configure segmentation job job.channel.vols = {'T1_structural.nii'}; job.channel.biasreg = 0.001; job.channel.biasfwhm = 60; job.channel.write = [0 1]; % [bias field, bias corrected] % Tissue probability maps (from SPM directory) spm_dir = spm('Dir'); job.tissue(1).tpm = {fullfile(spm_dir, 'tpm', 'TPM.nii,1')}; job.tissue(1).ngaus = 1; job.tissue(1).native = [1 0]; % [native, DARTEL] job.tissue(1).warped = [0 0]; % [modulated, unmodulated] job.tissue(2).tpm = {fullfile(spm_dir, 'tpm', 'TPM.nii,2')}; job.tissue(2).ngaus = 1; job.tissue(2).native = [1 0]; job.tissue(2).warped = [0 0]; job.tissue(3).tpm = {fullfile(spm_dir, 'tpm', 'TPM.nii,3')}; job.tissue(3).ngaus = 2; job.tissue(3).native = [1 0]; job.tissue(3).warped = [0 0]; % Additional tissues (skull, soft tissue, air) for k = 4:6 job.tissue(k).tpm = {fullfile(spm_dir, 'tpm', ['TPM.nii,' num2str(k)])}; job.tissue(k).ngaus = 2; job.tissue(k).native = [0 0]; job.tissue(k).warped = [0 0]; end % Warping options job.warp.mrf = 1; job.warp.cleanup = 1; job.warp.reg = [0 0.001 0.5 0.05 0.2]; job.warp.affreg = 'mni'; job.warp.fwhm = 0; job.warp.samp = 3; job.warp.write = [0 1]; % [inverse, forward] deformation fields % Run segmentation out = spm_preproc_run(job); disp('Segmentation outputs:'); disp(out); ``` -------------------------------- ### Explore Statistical Results with spm_results_ui Source: https://context7.com/spm/spm12/llms.txt Provides an interface for setting up statistical parametric maps, applying thresholds, and visualizing results. Includes methods for navigating coordinates and exporting filtered maps. ```matlab % Launch results GUI [hReg, xSPM, SPM] = spm_results_ui('Setup'); % Setup with specific parameters xSPM.swd = '/analysis/'; xSPM.Ic = 1; xSPM.u = 0.001; xSPM.k = 10; xSPM.thresDesc = 'FWE'; [hReg, xSPM, SPM] = spm_results_ui('Setup', xSPM); % Write thresholded map spm_write_filtered(xSPM.Z, xSPM.XYZ, xSPM.DIM, xSPM.M, 'Thresholded SPM', 'thresh_spm.nii'); ``` -------------------------------- ### Treatment Session and Dose Information Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt This section covers tags related to the overall treatment session, measured doses, and dose references. ```APIDOC ## GET /spm/spm12/treatment-summary ### Description Retrieves a summary of treatment session data, including measured doses and dose references. ### Method GET ### Endpoint /spm/spm12/treatment-summary ### Parameters #### Query Parameters - **patientId** (string) - Required - The unique identifier for the patient. - **studyInstanceUid** (string) - Required - The UID for the DICOM study. ### Response #### Success Response (200) - **measuredDoseReferenceSequence** (array) - Details of measured dose references. - **treatmentSessionBeamSequence** (array) - Information about beams used in the treatment session. #### Response Example { "measuredDoseReferenceSequence": [ { "measuredDoseDescription": "", "measuredDoseType": "", "measuredDoseValue": "" } ], "treatmentSessionBeamSequence": [ { "currentFractionNumber": "", "treatmentControlPointDate": "", "treatmentControlPointTime": "", "treatmentTerminationStatus": "" } ] } ``` -------------------------------- ### SVGElement Polyfill for getTransformToElement Source: https://github.com/spm/spm12/blob/main/external/fieldtrip/private/pipeline-skeleton.html Provides a polyfill for the SVGElement.prototype.getTransformToElement method, which was removed in Chrome 48. This ensures compatibility with older browser versions or environments where the method might be missing. It relies on ScreenCTM and inverse transformations. ```javascript SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); }; ``` -------------------------------- ### Receive Transducer Settings Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Details related to transducer settings used during image reception. ```APIDOC ## Receive Transducer Settings Sequence ### Description Sequence containing information about transducer settings. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **ReceiveTransducerSettingsSequence** (SQ) - Sequence of transducer settings. - **IncidentAngle** (DS) - Incident angle of the ultrasound beam. - **CouplingTechnique** (ST) - Technique used for coupling. - **CouplingMedium** (ST) - Medium used for coupling. - **CouplingVelocity** (DS) - Velocity of the coupling medium. - **CrystalCenterLocationX** (DS) - X-coordinate of the crystal center. - **CrystalCenterLocationZ** (DS) - Z-coordinate of the crystal center. - **SoundPathLength** (DS) - Length of the sound path. - **DelayLawIdentifier** (ST) - Identifier for the delay law. #### Response Example N/A ``` -------------------------------- ### SPM Batch Job Management with spm_jobman Source: https://context7.com/spm/spm12/llms.txt The spm_jobman function serves as the main interface for the SPM batch system, enabling non-interactive or GUI-driven execution of analysis pipelines. It supports initialization, interactive mode, running saved jobs, and programmatic batch creation. ```matlab spm_jobman('initcfg'); spm_jobman('interactive'); spm_jobman('run', 'my_analysis_batch.mat'); spm_jobman('run', 'preprocessing_batch.m'); clear matlabbatch; matlabbatch{1}.spm.spatial.realign.estwrite.data = {{'/data/func0001.nii,1', '/data/func0002.nii,1', '/data/func0003.nii,1' }}; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.quality = 0.9; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.sep = 4; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.fwhm = 5; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.rtm = 1; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.interp = 2; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0]; matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.weight = ''; matlabbatch{1}.spm.spatial.realign.estwrite.roptions.which = [2 1]; matlabbatch{1}.spm.spatial.realign.estwrite.roptions.interp = 4; matlabbatch{1}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0]; matlabbatch{1}.spm.spatial.realign.estwrite.roptions.mask = 1; matlabbatch{1}.spm.spatial.realign.estwrite.roptions.prefix = 'r'; matlabbatch{2}.spm.spatial.smooth.data(1) = cfg_dep('Realign: Reslice: Resliced Images', substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','rfiles')); matlabbatch{2}.spm.spatial.smooth.fwhm = [8 8 8]; matlabbatch{2}.spm.spatial.smooth.dtype = 0; matlabbatch{2}.spm.spatial.smooth.im = 0; matlabbatch{2}.spm.spatial.smooth.prefix = 's'; spm_jobman('run', matlabbatch); h = spm_jobman('help', 'spm.spatial.realign.estimate'); for i = 1:numel(h), fprintf('%s\n', h{i}); end ``` -------------------------------- ### Acquisition Parameters Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Parameters related to the image acquisition process. ```APIDOC ## Acquisition Parameters ### Description Parameters that define the image acquisition process. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **CineRate** (IS) - Rate of CINE mode playback. - **InitialCineRunState** (CS) - Initial state of the CINE run. - **SliceThickness** (DS) - Thickness of the acquired slice. - **KVP** (DS) - Kilovoltage peak (kVp) used during X-ray exposure. - **CountsAccumulated** (IS) - Accumulated counts during acquisition. - **AcquisitionTerminationCondition** (CS) - Condition that terminates acquisition. - **EffectiveDuration** (DS) - Effective duration of the acquisition. - **AcquisitionStartCondition** (CS) - Condition that starts acquisition. - **AcquisitionStartConditionData** (IS) - Data associated with the acquisition start condition. - **AcquisitionTerminationConditionData** (IS) - Data associated with the acquisition termination condition. - **RepetitionTime** (DS) - Repetition time (TR) in MRI. - **EchoTime** (DS) - Echo time (TE) in MRI. - **InversionTime** (DS) - Inversion time (TI) in MRI. - **NumberOfAverages** (DS) - Number of signal averages in MRI. - **ImagingFrequency** (DS) - Imaging frequency in MRI. - **ImagedNucleus** (SH) - Nucleus being imaged in MRI. - **EchoNumbers** (IS) - Echo number(s) in a multi-echo sequence. - **MagneticFieldStrength** (DS) - Magnetic field strength in Tesla for MRI. - **SpacingBetweenSlices** (DS) - Spacing between adjacent slices. - **NumberOfPhaseEncodingSteps** (IS) - Number of steps in the phase encoding direction. - **DataCollectionDiameter** (DS) - Diameter of the data collection region. - **EchoTrainLength** (IS) - Length of the echo train in MRI. - **PercentSampling** (DS) - Percentage of k-space sampled. - **PercentPhaseFieldOfView** (DS) - Percentage of the field of view covered by phase encoding. - **PixelBandwidth** (DS) - Pixel bandwidth in Hz. #### Response Example N/A ``` -------------------------------- ### SPM Function Definition and Structure (MATLAB) Source: https://github.com/spm/spm12/blob/main/spm_FcnTpl.txt This snippet defines a generic MATLAB function template for SPM. It includes H1 line, FORMAT, parameter descriptions, help text, and section headings. It serves as a blueprint for creating new SPM functions. ```MATLAB function [R1,...] = spm_FCN(P1,...) % <- H1 line : Single line description using keywords -> % FORMAT [R1,...] = spm_FCN(P1,...) % % P1 - <-Argument/parameter description, including ranges-> % R1 - <-Description of returned values-> %__________________________________________________________________________ % % HELP text % Long description of function, including i/o details, algorithms and refs. % %__________________________________________________________________________ % Copyright (C) YEAR Wellcome Trust Centre for Neuroimaging % AUTHOR % $Id: spm_FcnTpl.txt 5039 2012-11-06 20:39:58Z guillaume $ %========================================================================== % - B A N N E R S E C T I O N H E A D I N G %========================================================================== %-MAJOR section heading %========================================================================== %-MINOR section heading %-------------------------------------------------------------------------- % ---------------- ``` -------------------------------- ### LINAC Settings Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Settings related to Linear Accelerator (LINAC) parameters. ```APIDOC ## LINAC Settings ### Description Parameters related to the Linear Accelerator (LINAC) used in imaging. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **LINACEnergy** (IS) - Energy setting of the LINAC. - **LINACOutput** (IS) - Output setting of the LINAC. #### Response Example N/A ``` -------------------------------- ### Treatment Control Point and Delivery Details Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt This section details tags related to control points within a treatment session and the delivery of radiation. ```APIDOC ## GET /spm/spm12/control-points ### Description Retrieves details about treatment control points and radiation delivery parameters. ### Method GET ### Endpoint /spm/spm12/control-points ### Parameters #### Query Parameters - **patientId** (string) - Required - The unique identifier for the patient. - **studyInstanceUid** (string) - Required - The UID for the DICOM study. - **beamNumber** (integer) - Required - The number identifying the treatment beam. ### Response #### Success Response (200) - **controlPointDeliverySequence** (array) - Sequence of control point delivery details. - **ionControlPointDeliverySequence** (array) - Sequence of ion control point delivery details. #### Response Example { "controlPointDeliverySequence": [ { "specifiedMeterset": "", "deliveredMeterset": "", "metersetRateSet": "", "metersetRateDelivered": "", "scanSpotMetersetsDelivered": "", "doseRateDelivered": "" } ], "ionControlPointDeliverySequence": [ { "specifiedMeterset": "", "deliveredMeterset": "" } ] } ``` -------------------------------- ### Block Tray Information Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Details related to the block tray used in radiation therapy. ```APIDOC ## Block Tray Information ### Description This section describes the attributes related to the block tray, including its ID, dimensions, and type. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **BlockTrayID** (SH) - Required - Unique identifier for the block tray. - **SourceToBlockTrayDistance** (DS) - Required - Distance from the radiation source to the block tray. - **IsocenterToBlockTrayDistance** (FL) - Required - Distance from the isocenter to the block tray. - **BlockType** (CS) - Required - Type of block used (e.g., standard, custom). - **AccessoryCode** (LO) - Optional - Code for any accessories associated with the block. - **BlockDivergence** (CS) - Optional - Divergence characteristics of the block. - **BlockMountingPosition** (CS) - Optional - Position where the block is mounted. - **BlockNumber** (IS) - Optional - Sequential number of the block. - **BlockName** (LO) - Optional - Name of the block. - **BlockThickness** (DS) - Optional - Thickness of the block. - **BlockTransmission** (DS) - Optional - Transmission properties of the block. - **BlockNumberOfPoints** (IS) - Optional - Number of data points defining the block shape. - **BlockData** (DS) - Optional - Data points defining the block shape. ### Request Example ```json { "BlockTrayID": "TRAY-001", "SourceToBlockTrayDistance": 50.0, "IsocenterToBlockTrayDistance": 15.0, "BlockType": "STANDARD", "BlockThickness": 2.5 } ``` ### Response #### Success Response (200) - **BlockTrayID** (SH) - Unique identifier for the block tray. - **SourceToBlockTrayDistance** (DS) - Distance from the radiation source to the block tray. - **IsocenterToBlockTrayDistance** (FL) - Distance from the isocenter to the block tray. - **BlockType** (CS) - Type of block used. - **AccessoryCode** (LO) - Code for any accessories. - **BlockDivergence** (CS) - Divergence characteristics of the block. - **BlockMountingPosition** (CS) - Position where the block is mounted. - **BlockNumber** (IS) - Sequential number of the block. - **BlockName** (LO) - Name of the block. - **BlockThickness** (DS) - Thickness of the block. - **BlockTransmission** (DS) - Transmission properties of the block. - **BlockNumberOfPoints** (IS) - Number of data points defining the block shape. - **BlockData** (DS) - Data points defining the block shape. #### Response Example ```json { "BlockTrayID": "TRAY-001", "SourceToBlockTrayDistance": 50.0, "IsocenterToBlockTrayDistance": 15.0, "BlockType": "STANDARD", "BlockThickness": 2.5 } ``` ``` -------------------------------- ### Image Acquisition Context Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt General information about the image acquisition and examination. ```APIDOC ## Image Acquisition Context ### Description Contextual information about the image acquisition and the examination performed. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **BodyPartExamined** (CS) - Body part examined. - **ScanningSequence** (CS) - Scanning sequence used. - **SequenceVariant** (CS) - Variant of the scanning sequence. - **ScanOptions** (CS) - Options selected for the scan. - **MRAcquisitionType** (CS) - Type of MR acquisition. - **SequenceName** (SH) - Name of the sequence. - **AngioFlag** (CS) - Flag indicating if the acquisition is an angiogram. #### Response Example N/A ``` -------------------------------- ### Perform Between-Modality Coregistration with spm_coreg Source: https://context7.com/spm/spm12/llms.txt Aligns source images to a reference image using spm_coreg. This function utilizes cost functions like normalized mutual information and allows updating image headers with the estimated transformation matrix. ```matlab % Basic coregistration: align T1 to mean functional ref_image = spm_vol('meanfunc.nii'); source_image = spm_vol('T1_structural.nii'); x = spm_coreg(ref_image, source_image); disp('Estimated transformation parameters:'); disp(['Translation: ' num2str(x(1:3)) ' mm']); disp(['Rotation: ' num2str(x(4:6)*180/pi) ' degrees']); % Coregistration with custom parameters flags = struct(... 'sep', [4 2], ... % Optimization sampling steps (mm) 'params', [0 0 0 0 0 0], ...% Starting estimates 'cost_fun', 'nmi', ... % Normalized mutual information 'tol', [0.02 0.02 0.02 0.001 0.001 0.001], 'fwhm', [7 7], ... % Histogram smoothing 'graphics', 1); x = spm_coreg(ref_image, source_image, flags); % Apply transformation to update image header M = spm_matrix(x); MM = spm_get_space(source_image.fname); spm_get_space(source_image.fname, M \ MM); % Coregister multiple source images (e.g., other modalities) ref = spm_vol('T1.nii'); sources = spm_vol(char({'PD.nii', 'T2.nii', 'FLAIR.nii'})); for i = 1:numel(sources) x = spm_coreg(ref, sources(i), flags); M = spm_matrix(x); spm_get_space(sources(i).fname, M \ spm_get_space(sources(i).fname)); end ``` -------------------------------- ### Applicator Information Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Details related to applicators used in radiation therapy. ```APIDOC ## Applicator Information ### Description This section describes the attributes related to applicators, including their ID, type, and description. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **ApplicatorSequence** (SQ) - Required - Sequence of applicator information. - **ApplicatorID** (SH) - Required - Unique identifier for the applicator. - **ApplicatorType** (CS) - Required - Type of applicator. - **ApplicatorDescription** (LO) - Optional - Description of the applicator. - **CumulativeDoseReferenceCoefficient** (DS) - Optional - Coefficient for cumulative dose reference. - **FinalCumulativeMetersetWeight** (DS) - Optional - Final cumulative meterset weight. ### Request Example ```json { "ApplicatorSequence": [ { "ApplicatorID": "APP-001", "ApplicatorType": "FIELD", "ApplicatorDescription": "Standard Field Applicator", "CumulativeDoseReferenceCoefficient": 1.0, "FinalCumulativeMetersetWeight": 1.0 } ] } ``` ### Response #### Success Response (200) - **ApplicatorSequence** (SQ) - Sequence of applicator information. - **ApplicatorID** (SH) - Unique identifier for the applicator. - **ApplicatorType** (CS) - Type of applicator. - **ApplicatorDescription** (LO) - Description of the applicator. - **CumulativeDoseReferenceCoefficient** (DS) - Coefficient for cumulative dose reference. - **FinalCumulativeMetersetWeight** (DS) - Final cumulative meterset weight. #### Response Example ```json { "ApplicatorSequence": [ { "ApplicatorID": "APP-001", "ApplicatorType": "FIELD", "ApplicatorDescription": "Standard Field Applicator", "CumulativeDoseReferenceCoefficient": 1.0, "FinalCumulativeMetersetWeight": 1.0 } ] } ``` ``` -------------------------------- ### Intervention and Therapy Details Source: https://github.com/spm/spm12/blob/main/DICOM2011_dict.txt Information regarding interventional procedures and therapy types. ```APIDOC ## Intervention and Therapy Details ### Description Details about interventional procedures and the types of therapy administered. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **InterventionSequence** (SQ) - Sequence detailing the intervention. - **TherapyType** (CS) - Type of therapy administered. - **InterventionStatus** (CS) - Status of the intervention. - **TherapyDescription** (CS) - Description of the therapy. - **InterventionDescription** (ST) - Description of the intervention. #### Response Example N/A ``` -------------------------------- ### spm_coreg - Coregistration Source: https://context7.com/spm/spm12/llms.txt Performs between-modality rigid body coregistration using normalized mutual information or other cost functions. Aligns a source image to a reference image. ```APIDOC ## spm_coreg - Coregistration ### Description Performs between-modality rigid body coregistration using normalized mutual information or other cost functions. Aligns a source image to a reference image. ### Method MATLAB function call ### Endpoint N/A (MATLAB function) ### Parameters - **ref_image** (spm_vol object or string) - The reference image to align to. - **source_image** (spm_vol object or string) - The source image to be aligned. - **flags** (struct, optional) - Structure containing parameters for coregistration (sep, params, cost_fun, tol, fwhm, graphics). ### Request Example ```matlab % Basic coregistration: align T1 to mean functional ref_image = spm_vol('meanfunc.nii'); source_image = spm_vol('T1_structural.nii'); x = spm_coreg(ref_image, source_image); disp('Estimated transformation parameters:'); disp(['Translation: ' num2str(x(1:3)) ' mm']); disp(['Rotation: ' num2str(x(4:6)*180/pi) ' degrees']); % Coregistration with custom parameters flags = struct(... 'sep', [4 2], ... % Optimization sampling steps (mm) 'params', [0 0 0 0 0 0], ...% Starting estimates 'cost_fun', 'nmi', ... % Normalized mutual information 'tol', [0.02 0.02 0.02 0.001 0.001 0.001], ... 'fwhm', [7 7], ... % Histogram smoothing 'graphics', 1); x = spm_coreg(ref_image, source_image, flags); % Apply transformation to update image header M = spm_matrix(x); MM = spm_get_space(source_image.fname); spm_get_space(source_image.fname, M \ MM); % Coregister multiple source images (e.g., other modalities) ref = spm_vol('T1.nii'); sources = spm_vol(char({'PD.nii', 'T2.nii', 'FLAIR.nii'})); for i = 1:numel(sources) x = spm_coreg(ref, sources(i), flags); M = spm_matrix(x); spm_get_space(sources(i).fname, M \ spm_get_space(sources(i).fname)); end ``` ### Response - **x** (vector) - Estimated rigid body transformation parameters (translation and rotation). ### Response Example ```matlab % Example output of x (transformation parameters) % [ 1.5, -0.8, 0.2, 0.005, -0.01, 0.002 ] ``` ``` -------------------------------- ### Dynamic Plotly Data Loading and Plotting (JavaScript) Source: https://github.com/spm/spm12/blob/main/help/plot.html This script parses URL query parameters to dynamically load data and configurations for Plotly plots. It can load data from JSON files or execute external JavaScript files that define Plotly figures. It handles potential errors during data fetching and ensures the Plotly library is available. ```javascript var queries = location.search.split("?")[1]; if (typeof(queries) === "undefined") { alert("No data!"); } var query = queries.split("&"); for (var i = 0; i < query.length; i++) { var datatype = query[i].split("=")[0]; var filename = query[i].split("=")[1]; var ext = filename.split('.').pop(); if (ext === "js") { var firstScript = document.getElementsByTagName('script')[0]; var js = document.createElement('script'); js.src = filename; var data = {}, layout = {title: ""}, options = {}; js.onload = function () { Plotly.plot("plotly", data, layout, options); } firstScript.parentNode.insertBefore(js, firstScript); } else { Plotly.d3.json(filename, function(err, fig) { if (err) alert("Could not read data!"); if (fig.layout === "undefined") { fig.layout = {title: ""}; } if (fig.options === "undefined") { fig.options = {}; } Plotly.plot("plotly", fig.data, fig.layout, fig.options); }); } } ```