⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 anonymizer__define.pro

📁 DICOM viewer - this software is used to view a set of DICOM images.
💻 PRO
📖 第 1 页 / 共 4 页
字号:
            '0008,0090', $ ; Referring Physician
            '0008,0092', $ ; Referring Physician's Address
            '0008,1048', $ ; Physician(s) of Record
            '0008,1050', $ ; Performing Physician's Name
            '0008,1060', $ ; Name of Physician Reading Study
            '0008,1070', $ ; Operator's Name
            '0010,0010', $ ; Patient's Name
            '0010,0020', $ ; Patient ID
            '0010,0030', $ ; Patient's Birth Date
            '0010,1001', $ ; Other Patient Names
            '0010,1005', $ ; Patient's Birthname
            '0010,1010', $ ; Patients Age
            '0010,1040', $ ; Patient's Address
            '0010,1060', $ ; Patients Mother's Birth Name
            '0010,2154', $ ; Patient's Phone Numbers
            '0010,21D0', $ ; Last Mentrual Date
            '0012,0031', $ ; Clinical Trial Site Name
            '0012,0060', $ ; Clinical Trial Coordinating Center Name
            '0018,1012', $ ; Date of Secondary Capture
            '0018,1200', $ ; Date of Last Calibration
            '0018,700C', $ ; Date of Last Detector Calibration
            '0032,0032', $ ; Study Verified Date
            '0032,0034', $ ; Study Read Date
            '0032,1000', $ ; Scheduled Study Start Date
            '0032,1010', $ ; Scheduled Study Stop Date
            '0032,1032', $ ; Requesting Physician
            '0032,1040', $ ; Study Arrival Date
            '0032,1050', $ ; Study Completion Date
            '0038,0020', $ ; Admitting Date
            '0038,0030', $ ; Discharge Date
            '0038,001A', $ ; Scheduled Admission Date
            '0038,001C', $ ; Scheduled Discharge Date
            '0040,0002', $ ; Scheduled Procedure Step Start Date
            '0040,0004', $ ; Scheduled Procedure Step End Date
            '0040,0006', $ ; Scheduled Performing Physician's Name
            '0040,0244', $ ; Performed Procedure Step Start Date
            '0040,0250', $ ; Performed Procedure Step End Date
            '0040,1010', $ ; Names of Intended Recipients of Results
            '0040,2004', $ ; Issue Date of Imaging Service Request
            '0040,2008', $ ; Order Entered By
            '0040,4005', $ ; Scheduled Procedure Step Start DateTime
            '0040,4011', $ ; Expected Completion Date and Time
            '0040,4037', $ ; Human Performer's Name
            '0040,A030', $ ; Verification DateTime
            '0040,A032', $ ; Observation DateTime
            '0040,A075', $ ; Verifying Observer Name
            '0040,A120', $ ; DateTime
            '0040,A121', $ ; Date
            '0040,A123', $ ; Person Name
            '0040,A13A', $ ; Referenced DateTime
            '0070,0082', $ ; Presentation Creation Date
            '0070,0084', $ ; Presentation Creator's Name
            '0100,0420', $ ; SOP Authorization Date and Time
            '0400,0105', $ ; Digital Signature DateTime
            '2100,0040', $ ; Creation Date
            '3006,0008', $ ; Structure Set Date
            '3006,00A6', $ ; ROI Interpreter
            '3008,0024', $ ; Treatment Control Point Date
            '3008,0054', $ ; First Treatment Date
            '3008,0056', $ ; Most Recent Treatment Date
            '3008,0162', $ ; Safe Position Exit Date
            '3008,0166', $ ; Safe Position Return Date
            '3008,0250', $ ; Treatment Date
            '300A,0006', $ ; RT Plan Date
            '300A,022C', $ ; Air Kerma Rate Reference Date
            '300E,0004', $ ; Review Date
            '300E,0008', $ ; Reviewer Name
            '4008,0100', $ ; Interpretation Recorded Date
            '4008,0102', $ ; Interpretation Recorder
            '4008,0108', $ ; Interpretation Transcription Date
            '4008,010A', $ ; Interpretation Transcriber
            '4008,010C', $ ; Interpretation Author
            '4008,0122', $ ; Interpretation Approval Date
            '4008,0114', $ ; Physizian Approving Interpretation
            '4008,0119' $ ; Distribution Name
                        ]

        self.static_tags  = ptr_new(self->make_structure(tags))

    endif

    if keyword_set(dyv) then $
        if n_elements(*self.dynamic_tags) gt 0 then $
            self -> define_tags, (*self.dynamic_tags).tag

end




;*********************************************************************
; Anonymizer::Restore_Preferences
;+
;
; Restores user preferences from an IDL Save file.
;
; @returns 1 if user preferences are successfully loaded and 0 otherwise.
;
;-
function anonymizer::restore_preferences

    if file_test(self.pref_file) then begin

        restore, self.pref_file

        self.attribute_values = vr_values
        self.outdir = outdir
        self.outfile_prefix = prefix
        self.outfile_extension = extension

        if ~obj_valid(self.odicom) then begin

            *self.static_tags = static_tags
            if n_elements(dynamic_tags) gt 0 then $
                *self.dynamic_tags = dynamic_tags

        endif else begin

            self -> define_tags, static_tags, /no_wizard

            if n_elements(dynamic_tags) gt 0 then $
                self -> define_tags, dynamic_tags, /no_wizard

        endelse

        return, 1

    endif else begin

        self.attribute_values = self.default_att_values
        self.outfile_prefix = ''
        self.outfile_extension = '.dcm'
        return, 0

    endelse

end



;*********************************************************************
; Anonymizer::Save_Preferences
;+
;
; Saves current preferences to a file for later use.
;
;-

pro anonymizer::save_preferences

    if file_test(self.pref_file) then begin

        void = dialog_message(/quest, $
            'Overwrite existing preferences?')
        if strlowcase(void) eq 'no' then $
            return

        restore, self.pref_file

    endif

    static_tags = *self.static_tags
    outdir = self.outdir
    vr_values = self.attribute_values
    prefix = self.outfile_prefix
    extension = self.outfile_extension

    if n_elements(*self.dynamic_tags) gt 0 then begin

        dynamic_tags = *self.dynamic_tags
        save, file = self.pref_file, outdir, vr_values, $
            static_tags, dynamic_tags, prefix, extension

    endif else $
        save, file = self.pref_file, outdir, vr_values, static_tags, $
            prefix, extension

end



;*********************************************************************
; Anonymizer::Set_VR_Value
;+
;
;  Modifies default tag values per VR (Value Representation).
;
; @keyword AGE_STRING {in}{type=string} Sets the default
;          value for Age String value representation.
; @keyword APPLICATION_ENTITY {in}{type=string} Sets the default
;          value for Application Entity value representation.
; @keyword ATTRIBUTE_TAG {in}{type=string} Sets the default
;          value for Attribute Tag value representation.
; @keyword ATTRIBUTE_VALUES {in}{type=structure} Sets the default
;          value for Attribute Values value representation.
; @keyword CODE_STRING{in}{type=ulong} Sets the default
;          value for Code String value representation.
; @keyword DATE {in}{type=string} Sets the default
;          value for Date value representation.
; @keyword DECIMAL_STRING {in}{type=string} Sets the default
;          value for Decimal String value representation.
; @keyword DATE_TIME {in}{type=string} Sets the default
;          value for DateTime value representation.
; @keyword SINGLE_FLOATING_POINT {in}{type=float} Sets the default
;          value for Single Floating Point value representation.
; @keyword DOUBLE_FLOATING_POINT {in}{type=double} Sets the default
;          value for Double Floating Point value representation.
; @keyword INTEGER_STRING {in}{type=string} Sets the default
;          value for Integer String value representation.
; @keyword LONG_STRING {in}{type=string} Sets the default
;          value for Long String value representation.
; @keyword LONG_TEXT {in}{type=string} Sets the default
;          value for Long Text value representation.
; @keyword OTHER_BYTE_STRING {in}{type=byte} Sets the default
;          value for Other Byte String value representation.
; @keyword OTHER_FLOAT_STRING {in}{type=float} Sets the default
;          value for Other Float String value representation.
; @keyword OTHER_WORD_STRING {in}{type=int} Sets the default
;          value for Other Word String value representation.
; @keyword PERSON_NAME {in}{type=string} Sets the default
;          value for Person Name value representation.
; @keyword SHORT_STRING {in}{type=string} Sets the default
;          value for Short String value representation.
; @keyword SIGNED_LONG {in}{type=long} Sets the default
;          value for Signed Long value representation.
; @keyword SEQUENCE_OF_ITEMS {in}{type=long} Sets the default
;          value for Sequence of Items value representation.
; @keyword SIGNED_SHORT {in}{type=int} Sets the default
;          value for Signed Short value representation.
; @keyword SHORT_TEXT {in}{type=string} Sets the default
;          value for Short Text value representation.
; @keyword TIME {in}{type=string} Sets the default
;          value for Time value representation.
; @keyword UNIQUE_IDENTIFIER {in}{type=string} Sets the default
;          value for Unique Identifier value representation.
; @keyword UNSIGNED_LONG {in}{type=ulong} Sets the default
;          value for Unsigned Long value representation.
; @keyword UNKNOWN {in}{type=byte} Sets the default
;          value for Unknown value representation.
; @keyword UNSIGNED_SHORT {in}{type=uint} Sets the default
;          value for Unsigned Short value representation.
; @keyword UNLIMITED_TEXT {in}{type=string} Sets the default
;          value for Unlimited Text value representation.
;
;-

pro anonymizer::set_vr_value, $
    attribute_values = av, $
    application_entity = ae, $
    age_string = as, $
    attribute_tag = at, $
    code_string = cs, $
    date = da, $
    decimal_string = ds, $
    date_time = dt, $
    single_floating_point = fl, $
    double_floating_point = fd, $
    integer_string = is, $
    long_string = lo, $
    long_text = _lt, $
    other_byte_string = ob, $
    other_float_string = _of, $
    other_word_string = ow, $
    person_name = pn, $
    short_string = sh, $
    signed_long = sl, $
    sequence_of_items = sq, $
    signed_short = ss, $
    short_text = st, $
    time = tm, $
    unique_identifier = ui, $
    unsigned_long = ul, $
    unknown = un, $
    unsigned_short = us, $
    unlimited_text = ut

    ns = n_elements(*self.static_tags)
    nd = n_elements(*self.dynamic_tags)

    st_default = bytarr(ns)+1
    for i = 0, ns-1 do $
        if ((*self.static_tags)[i].flag gt 0) then begin

            if (*self.static_tags)[i].value ne $
            self->get_default_vr_value((*self.static_tags)[i].tag) then $
                st_default[i] = 0

        endif else $
            st_default[i] = 0

    if nd gt 0 then begin

        dy_default = bytarr(nd)+1

        for i = 0, nd-1 do $
            if ((*self.dynamic_tags)[i].flag gt 0) then begin

                if (*self.dynamic_tags)[i].value ne $
                self->get_default_vr_value((*self.dynamic_tags)[i].tag) then $
                    dy_default[i] = 0

            endif else $
                dy_default[i] = 0

    endif

    if (n_elements(ae) gt 0) then $
        if self->check_vr_value(ae[0], string_val = sval) then $
            self.attribute_values.ae = sval

    if (n_elements(as) gt 0) then $
        if self->check_vr_value(as[0], string_val = sval) then $
            self.attribute_values.as = sval

    if (n_elements(at) gt 0) then $
        if self->check_vr_value(at[0], string_val = sval) then $
            self.attribute_values.at = sval

    if (n_elements(cs) gt 0) then $
        if self->check_vr_value(cs[0:1], ulong_val = ulval) then $
            self.attribute_values.cs = ulval

    if (n_elements(da) gt 0) then $
        if self->check_vr_value(da[0], string_val = sval) then $
            self.attribute_values.da = sval

    if (n_elements(ds) gt 0) then $
        if self->check_vr_value(ds[0], string_val = sval) then $
            self.attribute_values.ds = sval

    if (n_elements(dt) gt 0) then $
        if self->check_vr_value(dt[0], string_val = sval) then $
            self.attribute_values.dt = sval

    if (n_elements(fl) gt 0) then $
        if self->check_vr_value(fl[0], float_val = fval) then $
            self.attribute_values.fl = fval

    if (n_elements(fd) gt 0) then $
        if self->check_vr_value(fd[0], double_val = dval) then $
            self.attribute_values.fd = dval

    if (n_elements(is) gt 0) then $
        if self->check_vr_value(is[0], string_val = sval) then $
            self.attribute_values.is = sval

    if (n_elements(ls) gt 0) then $
        if self->check_vr_value(ls[0], string_val = sval) then $
            self.attribute_values.ls = sval

    if (n_elements(_lt) gt 0) then $
        if self->check_vr_value(_lt[0], string_val = sval) then $
            self.attribute_values._lt = sval

    if (n_elements(ob) gt 0) then $
        if self->check_vr_value(ob, byte_val = bval) then $
            self.attribute_values.ob = bval

    if (n_elements(_of) gt 0) then $
        if self->check_vr_value(_of, float_val = fval) then $
            self.attribute_values._of = fval

    if (n_elements(ow) gt 0) then $
        if self->check_vr_value(ow, int_val = ival) then $
            self.attribute_values.ow = ival

    if (n_elements(pn) gt 0) then $
        if self->check_vr_value(pn[0], string_val = sval) then $
            self.attribute_values.pn = sval

    if (n_elements(sh) gt 0) then $
        if self->check_vr_value(sh[0], string_val = sval) then $
            self.attribute_values.sh = sval

    if (n_elements(sl) gt 0) then $
        if self->check_vr_value(sl[0], long_val = lval) then $
            self.attribute_values.sl = lval

    if (n_elements(sq) gt 0) then $
        if self->check_vr_value(sq, long_val = lval) then $
            self.attribute_values.sq = lval

    if (n_elements(ss) gt 0) then $
        if self->check_vr_value(ss, int_val = ival) then $
            self.attribute_values.ss = ival

    if (n_elements(st) gt 0) then $
        if self->check_vr_value(st[0], string_val = sval) then $
            self.attribute_values.st = sval

    if (n_elements(tm) gt 0) then $
        if self->check_vr_value(tm[0], string_val = sval) then $
            self.attribute_values.tm = sval

    if (n_elements(ui) gt 0) then $
        if self->check_vr_value(ui[0], string_val = sval) then $
            self.attribute_values.ui = sval

    if (n_elements(ul) gt 0) then $
        if self->check_vr_value(ul[0], ulong_val = ulval) then $
            self.attribute_values.ul = ulval

    if (n_elements(un) gt 0) then $
        if self->check_vr_value(un[0], byte_val = bval) then $
            self.attribute_values.un = bval

    if (n_elements(us) gt 0) then $
        if self->check_vr_value(us[0:1], uint_val = uival) then $
            self.attribute_values.us = uival

    if (n_elements(ut) gt 0) then $
        if self->check_vr_value(ut[0], string_val = sval) then $
            self.attribute_values.ut = sval

    if n_elements(av) gt 0 then $
        if n_tags(av[0]) eq n_tags(self.attribute_values) then $
            self.attribute_values = av

; Set any static tags that were using the default:
    if total(st_default gt 0) then $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -