- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# C:/AngioLocalizeNoAuto/MevisLabNoAutoReg/STUMevisApp/General/Sources/ML/STUCSOToRTStructure/STUCSOToRTStructure.h

    00001 /*
    00002 * Copyright (c) 2009 Stanford University, School of Medicine All rights reserved.
    00003 *
    00004 * STANFORD ACADEMIC SOFTWARE LICENSE AGREEMENT
    00005 * FOR AngioLocalize SOURCE CODE:
    00006 *
    00007 * 1.  This is a legal agreement between you, RECIPIENT, and STANFORD UNIVERSITY.
    00008 *       By accepting, receiving, and using AngioLocalize.including any accompanying information, materials or
    00009 *       manuals (Program), you are agreeing to be bound by the terms of this Agreement.
    00010 *       If you do not agree to the terms of this Agreement, promptly return the Program to the STANFORD.
    00011
    00012 * 2.  STANFORD grants to RECIPIENT a royalty-free, nonexclusive, and nontransferable license to use the Program
    00013 *       and accompanying source code furnished hereunder, upon the terms and conditions set out below.
    00014 *       documentation and/or other materials provided with the distribution.
    00015 * 3.  RECIPIENT acknowledges that the Program is a research tool still in the development stage and that
    00016 *       it is being supplied as is, without any accompanying services, support or improvements from STANFORD.
    00017 * 4.  RECIPIENT agrees to use the Program solely for internal non-commercial purposes.
    00018 * 5.  RECIPIENT may create derivatives and further transfer the Program under the following terms and conditions:
    00019 *        A) Recipient agrees to not commercially exploit the Program and agrees all uses will be for non-commercial purposes; and,
    00020 *        B) Recipient may not mark any derivatives with the title of Program and may not to use iPad mark for any derivatives; and,
    00021 *        C) Recipient agrees to mark and acknowledge all derivatives as follows: "This is a derivative work based on AngioLocalize:
    00022 *           Frameless AVM localization with 2D Digital Subtraction Angiography (DSA) and 3D Rotational Angiography (DRA) Images developed
    00023 *           by Dimitre Hristov, Lina Liu.
    00024 *        D) Recipient agrees to make all improvements, enhancements and derivatives available under
    00025 *           similar terms and conditions to the research community.
    00026 * 6.   RECIPIENT warrants that RECIPIENT will not remove or export any part of the software or Program from the United
    00027 *       States except in full compliance with all United States and other applicable laws and regulations.
    00028 * 7.  RECIPIENT will use the Program in compliance with all applicable laws, policies and regulations including, but not
    00029 *       limited to, any approvals, informed consent and patient confidentiality principles.
    00030 * 8.   RECIPIENT will indemnify, hold harmless, and defend Stanford against any claim of any kind arising out of or
    00031 *       related to the exercise of any rights granted under this Agreement or the breach of this Agreement by RECIPIENT.
    00032 * 9.  Title and copyright to the Program and any associated documentation shall at all times remain with STANFORD,
    00033 *       and RECIPIENT agrees to preserve same.
    00034 */
    00035 //----------------------------------------------------------------------------------
    00036
    00037
    00038 #ifndef __mlCSOToRTStructure_H
    00039 #define __mlCSOToRTStructure_H
    00040
    00041
    00042 // Local includes
    00043 #include <DCMTree_UIDGenerator.h>
    00044 #include "STUCSOToRTStructureSystem.h"
    00045 #include <CSOBase/CSOList.h>
    00046
    00047 // ML includes
    00048 #include "mlOperatorIncludes.h"
    00049 #include <DCMTree_Lib.h>
    00050 #include "DCMTree_IOParameter.h"
    00051 #include "DCMTree_Reader.h"
    00052 #include "DCMTree_Dict.h"
    00053 #include "DCMTree_Tag.h"
    00054 #include "DCMTree_Value.h"
    00055 #include "DCMTree_Unicode.h"
    00056 #include "DCMTree_Writer.h"
    00057 #include <dcmtree_dicomtags.h>
    00058 #include <dcmtree_exception.h>
    00059 #include <dcmtree_message.h>
    00060 #include <CSOBase/CSOList.h>
    00061 #include "mlBase.h"
    00062
    00063
    00064 ML_START_NAMESPACE
    00065
    00066
    00068 class STUCSOTORTSTRUCTURE_EXPORT CSOToRTStructure : public BaseOp
    00069 {
    00070 public:
    00071
    00073   CSOToRTStructure ();
    00074
    00076   ~CSOToRTStructure () {}
    00077
    00078
    00080   virtual void handleNotification (Field *field);
    00081   virtual void calcOutImageProps (int outIndex);
    00082   DCMTree::TreePtr getTreeHeaderPtr() {return _treeHeaderPtr;}
    00083   CSOList* getInputCSOs() {return _inputCSOs;}
    00084   BaseOp::INPUT_HANDLE handleInput(int /*inIndex*/, INPUT_STATE /*state*/) const;
    00086   static std::map<std::string, std::string>  _modalitySOPClassUIDMap;
    00087   void activateAttachments ();
    00088   void setValidFld(bool valid) {_validFld->setToggleValue(valid);}
    00089   static void setValid(CSOToRTStructure* obj);
    00091   bool _isInNotificationCB;
    00093   void updateGenTreeHeader(PagedImg *img);
    00094
    00095 private:
    00096
    00097   BaseField                     *_inListFld;
    00098   DCMTree::TreePtr  _treeHeaderPtr;
    00099   DCMTree::TreePtr  _genTreePtr;
    00100   CSOList                       *_inputCSOs;
    00101   NotifyField       *_applyFld;
    00102   ToggleField         *_validFld;
    00103   std::string       _refSopClassUID;
    00104   static bool       isInitialized;
    00105
    00106   //map of SOPInstUIDs and position
    00107   std::map< float, std::string>  _mSOPInstUIDs;
    00108
    00110   StringField           *_rtStructFileFld;
    00111   float             _voxelSizeZ;
    00112
    00115   bool combineHeader();
    00117   std::string getRefUID(double z);
    00119   void addTag(DCMTree::TreePtr &parent, DCMTree::TagId tagId, std::string value, DCMTree::Vr vr);
    00121   void addSequence(DCMTree::TreePtr parentTree, DCMTree::TreePtr childTree, DCMTree::TagId tagId);
    00123   void addSequenceTag(DCMTree::TreePtr &parent, DCMTree::TagId tagId);
    00125   void writeToDCMFile(DCMTree::TreePtr tree, std::string dest);
    00127   bool combineSOPInstUID(DCMTree::TagPtr conImageTag, std::string UID);
    00129   bool addCSOGroupTags(DCMTree::TagPtr csoGroupTag, std::string refFOfRef);
    00131   bool addCSOTags(DCMTree::TagPtr csoTag,DCMTree::TreePtr contourTree);
    00133   void addCSOPathPoint(DCMTree::TreePtr childTree, DCMTree::TagId tagId, DCMTree::Vr vr, ml::CSO* cso);
    00135   void addRTROIObTags(DCMTree::TagPtr RTROIObTag, DCMTree::TreePtr RTROIObSeq);
    00137   void setValidField();
    00138
    00139
    00140
    00142   static void CSOListNotifyObserverCB(void* userData, int notificationFlag);
    00143
    00145   ML_BASEOP_CLASS_HEADER(CSOToRTStructure)
    00146 };
    00147
    00148
    00149 ML_END_NAMESPACE
    00150
    00151 #endif // __mlCSOToRTStructure_H
    00152

All Classes Namespaces Files Functions Variables Enumerator Friends