📄 search-page.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!-- Generated by IDLdoc on Mon Jun 13 11:04:16 2005 -->
<HEAD>
<TITLE>Search (Research Systems, Inc.)</TITLE>
<LINK REL=stylesheet TYPE="text/css" HREF="idldoc.css" TITLE="main_style">
<SCRIPT language=JavaScript>
<!--
a = new Array();
a[1] = new Array("./anonymizer__define.html", "anonymizer__define.pro", "", " CLASS Anonymizer SUPERCLASS None PURPOSE For anonymizing DICOM files METHODS: Anonymize Create anonymized copy of current DICOM file Check_VR_Value Determines if value can be used to represent a specific value representation Cleanup Lifecycle method Define_Tags Adds Removes tags from the list of tags to be anonymized Get_Default_VR_Value Retrives the default value for a given value representation Get_Dicom_Value_String Returns the value from the current DICOM file for a given attribute tag GetProperty Return a current property value Init Lifecycle method Make_Structure Creates a structure from a string array containing standard DICOM attribute tags Query_Wizard Checks to see if wizard is currently active Reset Resets output tag values to the Anonymizer defaults Restore_Preferences Restores user preferences saved from a previous session Save_Preferences Saves the current preferences to be used in the future Set_VR_Value Modifies default tag values per VR Value Representation SetProperty Set a property value Wizard Start the Anonymizer wizard Modification History June 2005 Written: Daryl Atencio Anonymizer::Anonymize Uses current Anonymizer settings DYNAMIC_TAGS and STATIC_TAGS to create an anonymized Dicom file returns The name Including path of the anonymized file Returns otherwise keyword WIZARD in type boolean Set this keyword to launch the anonymization wizard function anonymizer::anonymize wizard wizard Has ODICOM been initialized if obj_valid self odicom then return if keyword_set wizard self no_block then begin Launch the anonymizer wizard self wizard from_anonymize Object was destroyed while wizard was active: if obj_valid self then return if self wizard_cont then return self wizard_cont 0 endif for f 1 2 do begin F 1 : Dynamic Tags F 2 : Static Tags for i 0 n_elements self f 1 do begin err 0 catch err if err ne 0 then begin catch cancel continue endif Write the information from the Static Dynamic structre to the Dicom file if self f i flag gt 0 self value_only then begin vr self odicom getvr self f i tag self odicom setvalue self f i tag vr self f i value endif endfor endfor Commit changes self odicom commit self odicom getproperty sop_instance_uid uid Output filename: anon_file self outdir self outfile_prefix uid self outfile_extension Rename the output file file_move self tempfile anon_file Return the name of the output file return anon_file end Anonymizer::Check_VR_Value Determines whether a value can be used to represent a specific value representation returns 1 if VAL can be converted to the type specified by a keyword input and 0 otherwise param VAL in type any keyword BYTE_VAL out type byte Returns byte representation of VAL keyword DOUBLE_VAL out type double Returns double representation of VAL keyword FLOAT_VAL out type float Returns float represenations of VAL keyword INT_VAL out type integer Returns integer represenations of VAL keyword LONG_VAL out type long integer Returns long integer represenations of VAL keyword STRING_VAL out type string Returns string represenations of VAL keyword UINT_VAL out type unsigned integer Returns integer represenations of VAL keyword ULONG_VAL out type unsigned long integer Returns unsigned long integer represenations of VAL private function anonymizer::check_vr_value val byte_val bv double_val dv float_val fv int_val iv long_val lv string_val sv uint_val uiv ulong_val ulv err 0 catch err if err ne 0 then begin catch cancel return 0 endif if arg_present bv then bv byte val if arg_present dv then dv double val if arg_present fv then fv float val if arg_present iv then iv fix val if arg_present lv then lv long val if arg_present sv then sv string val if arg_present uiv then uiv uint val if arg_present ulv then ulv ulong val return 1 end Anonymizer::Cleanup Free any memory used by this object pro anonymizer::cleanup if obj_valid self odicom then obj_destroy self odicom if obj_valid self wizard then begin obj_destroy self wizard endif ptr_free self static_tags self dynamic_tags end Anonymizer::Define_Tags Used to add remove tags from the list of attribute tags to be anonymized param TAGS in type string Tags to be added removed from the anonymizer keyword NO_WIZARD_UPDATE in type boolean If this keyword is set the wizard will not update according to the changes made by this method keyword REMOVE in type boolean Set to True 1 to remove TAGS from the list to be anonymized Set to False 0 to add TAGS to the list of tags to be anonymized pro anonymizer::define_tags tags remove remove no_wizard_update nw No file specified if obj_valid self odicom then return nt n_elements tags No tags if nt lt 1 then return remove keyword_set remove case size tags type of 7: if remove then begin tags self make_structure tags endif 8: begin if array_equal strlowcase tag_names tags 0 desc tag value flag then return if remove then tags tags tag else begin tags tags uniq tags tag sort tags tag nt n_elements tags for i 0 nt 1 do begin err 0 catch err if err ne 0 then begin catch cancel help last continue endif tags i flag self odicom queryvalue tags i tag if tags i flag ge 1 then tags i desc self odicom getdescription tags i tag else tags i desc endfor endelse end else: return endcase if remove then begin Removing tags nd n_elements self dynamic_tags No dynamic tags defined if nd eq 0 then return ind bytarr nd 1 for i 0 nt 1 do begin w where self dynamic_tags tag eq tags i if w 0 ne 1 then ind w 0 endfor ti total ind if ti lt nd then begin if ti eq 0 then begin ptr_free self dynamic_tags self dynamic_tags ptr_new allocate endif else begin self dynamic_tags self dynamic_tags where ind endelse endif Remove tags from wizard if active: if keyword_set nw then if self wizard query_wizard_dialog then for i 0 n_elements tags 1 do self wizard remove_tag_base tags i endif else begin Adding tags Check STATIC_TAGS ind bytarr nt 1 for i 0 nt 1 do begin w where self static_tags tag eq tags i tag 0 if w ne 1 then begin ind i 0 self static_tags w value tags i value endif endfor Remove static elements from TAGS w where ind if w 0 eq 1 then return tags tags w Check DYNAMIC_TAGS if n_elements self dynamic_tags gt 0 then begin nt n_elements tags ind bytarr nt 1 for i 0 nt 1 do begin w where self dynamic_tags tag eq tags i tag 0 if w ne 1 then begin ind i 0 self dynamic_tags w value tags i value endif endfor w where ind if w 0 eq 1 then return self dynamic_tags self dynamic_tags tags w endif else begin self dynamic_tags tags endelse Update the wizard if active if keyword_Set nw then if self wizard query_wizard_dialog then for i 0 n_elements tags 1 do self wizard add_tag tags i endelse end Anonymizer::Get_Default_VR_Value Retrieves the default value for a specified value representation returns The current default value for a specific tag param TAG in type string A string of the form gggg eeee where gggg and eeee represent the group and element number respectively for the attribute for which the default is being returned function anonymizer::get_default_vr_value tag err 0 catch err if err ne 0 then begin catch cancel return endif vr self odicom getvr tag case strlowcase vr of ae : return self attribute_values ae as : return self attribute_values as at : return self attribute_values at cs : return self attribute_values cs da : return self attribute_values da dl : return self attribute_values dl ds : return self attribute_values ds dt : return self attribute_values dt fl : return self attribute_values fl fd : return self attribute_values fd is : return self attribute_values is lo : return self attribute_values lo lt : return self attribute_values _lt ob : return self attribute_values ob of : return self attribute_values _of ow : return self attribute_values ow pn : return self attribute_values pn sh : return self attribute_values sh sl : return self attribute_values sl sq : ss : return self attribute_values ss st : return self attribute_values st tm : return self attribute_values tm ui : ul : return self attribute_values ul un : return self attribute_values un us : return self attribute_values us ut : return self attribute_values ut else: return AAAAnonymous endcase end Anonymizer::Get_Dicom_Value_String Retrieves the value for a specified tag in the current DICOM file If this tag is not defined in the file is returned returns A string containing the value for a specified tag in the DICOM file Returns otherwise param TAG in type string A scalar string of the form gggg eeee where gggg and eeee represent the group and element number respectively for the attribute for which the value is being returned function anonymizer::get_dicom_value_string tag if n_elements tag lt 1 then return tag tag 0 err 0 catch err if err ne 0 then begin message Invalid DICOM Attribute Tag : strtrim tag 2 continue return endif if self odicom queryvalue tag eq 2 then return string self odicom getvalue tag else return end Anonymizer::GetProperty Returns the current value of an object property keyword ATTRIBUTE_VALUES out type structure Current default attribute values keyword DYNAMIC_TAGS out type structure Dynamic tags to be anonymized keyword OUTDIR out type string Output directory for anonymized file keyword OUTFILE_EXTENSION out type string Output file extension for anonymized file keyword OUTFILE_PREFIX out type string Output file prefix for anonymized file keyword STATIC_TAGS out type structure Static tags to be anonymized keyword VALUE_ONLY out type byte Determines what tags get written to the anonymized file If VALUE_ONLY is set to 1 only attribute tags that exist and are defined in the original file are written to the anonymized file If VALUE_ONLY is set to 0 then all tags that exist in the orignal file are written to the anonymized file pro anonymizer::getproperty dynamic_tags dtags static_tags stags attribute_values av outdir outdir outfile_extension ofe outfile_prefix ofp value_only vo if arg_present stags then stags self static_tags if arg_present dtags then begin if n_elements self dynamic_tags gt 0 then dtags self dynamic_tags else dtags endif if arg_present av then av self attribute_values if arg_present outdir then outdir self outdir if arg_present ofe then ofe self outfile_extension if arg_present ofp then ofp self outfile_prefix if arg_present vo then vo self value_only end Anonymizer::Init returns True 1 if the object is successfully created and False 0 otherwise param FILE in type string Dicom file to be anonymized keyword FROM_APPLICATION in type boolean Anonymizer was launched from an application keyword NO_BLOCK in type boolean Set to 0 to have the Anonymizer Wizard block Set to 1 for no blocking keyword VALUE_ONLY in type byte Sets the VALUE_ONLY field of the class structure If VALUE_ONLY is set to 1 only attribute tags that exist and are defined in the original file are written to the anonymized file If VALUE_ONLY is set to 0 then all tags that exist in the orignal file are written to the anonymized file function anonymizer::init file value_only val_only from_application fa no_block nb authordirname rsi authordesc Research Systems Inc appdirname anonymizer appdesc Anonymizes DICOM files appreadmetext Author: rsi Anonymizer application preferences are stored in this directory appreadmeversion 1 dir app_user_dir authordirname authordesc appdirname appdesc appreadmetext appreadmeversion self pref_file dir path_sep anonymizer_prefs dat self value_only keyword_set val_only cd c d self outdir d path_sep self static_tags ptr_new allocate self dynamic_tags ptr_new allocate self default_att_values attribute_values Anonymous 00 0u 0 ANONYMOUS 19000101 19000101000000 values f_nan values d_nan Anonymous Anonymous 0b values f_nan 0 Anonymous Anonymous 0l 0 Anonymous 000000 0ul 0b 0u Anonymous self no_block keyword_set nb self wizard obj_new awizard self user_pref self restore_preferences no_block keyword_set nb from_application keyword_set fa if n_elements file gt 0 then self setproperty file file self wizard_cont 0 return 1 end Anonymizer::Make_Structure Creates a structure to be used by Anonymizer from a scalar string or a string array containing attribute tags param S in type string Scalar string or string array from which the anonymizer structure is created private function anonymizer::make_structure s Creates a structure from a string array compile_opt hidden s s uniq s sort s ns n_elements s if ns lt 1 then return str desc: tag: value: flag:1b tag_structures replicate str ns for i 0 ns 1 do begin err 0 catch err if err ne 0 then begin tag_structures i flag 0 catch cancel message Invalid DICOM Attribute Tag : strtrim tag_structures i tag 2 cont continue endif tag_structures i tag s i tag_structures i flag self odicom queryvalue s i if tag_structures i flag ge 1 then begin tag_structures i desc self odicom getdescription s i tag_structures i value self get_default_vr_value tag_structures i tag endif else tag_structures i desc endfor return tag_structures end Anonymizer::Query_Wizard Returns 1 if the Anonymizer Wizard is currently active and 0 otherwise returns 1 if the Anonymizer Wizard is currently active and 0 otherwise function anonymizer::query_wizard return self wizard query_wizard_dialog end Anonymizer::Reset Resets the Anonymizer values to the default values keyword ALL in type boolean Reset all fields keyword DEFAULT_VALUES in type boolean Set default values for each value representation to the Anonymizer defaults keyword DYNAMIC_TAGS in type boolean Update Anonymizer s dynamic tags to use default values keyword OUTFILE_EXTENSION in type boolean Sets the output file s extension to dcm keyword OUTFILE_PREFIX in type boolean Sets the output file s prefix to keyword STATIC_TAGS in type boolean Update Anonymizer s static tags pro anonymizer::reset static_tags st default_values dv dynamic_tags dyv outfile_extension ofe outfile_prefix ofp all all if keyword_set all then begin ofe ofp st dv dyv 1 self wizard setproperty user_preferences 0 endif if keyword_set dv then self attribute_values self default_att_values if keyword_set ofe then self outfile_prefix if keyword_set ofp then self outfile_extension dcm if keyword_set st then begin ptr_free self static_tags tags 0008 0012 Instance Creation Date 0008 0020 Study Date 0008 0021 Series Date 0008 0022 Acquisition Date 0008 0023 Content Date 0008 0024 Overlay Date 0008 0025 Curve Date 0008 002A Aquisition DateTime 0008 0080 Institution Name 0008 0081 Institution Address 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 for i 0 ns 1 do if st_default i then self static_tags i value self get_default_vr_value self static_tags i tag Set any dynamic tags that were using the default: if nd gt 0 then if total dy_default gt 0 then for i 0 nd 1 do if dy_default i then self dynamic_tags i value self get_default_vr_value self dynamic_tags i tag end Anonymizer::SetProperty Sets the current value of an object property 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 FILE in type string Sets the name of the DICOM file to be anonymized 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 NO_BLOCK Sets the blocking status of the Anonymizer wizard 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 OUTPUT_DIRECTORY in type string Sets the directory to which the anonymized files will be written keyword OUTFILE_EXTENSION in type string Sets the anonymized files filename extension keyword OUTFILE_PREFIX in type string Sets the anonymized files filename prefix 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 keyword VALUE_ONLY in type boolean Sets the VALUE_ONLY field If VALUE_ONLY is set to 1 only attribute tags that exist and are defined in the original file are written to the anonymized file If VALUE_ONLY is set to 0 then all tags that exist in the orignal file are written to the anonymized file pro anonymizer::setproperty file file output_directory od wizard_cont cont no_block nb value_only val_only outfile_extension ofe outfile_prefix ofp 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 Setting default attribute values per VR: if n_elements ae gt 0 then self set_vr_value application_entity ae if n_elements as gt 0 then self set_vr_value age_string as if n_elements at gt 0 then self set_vr_value attribute_tag at if n_elements cs gt 0 then self set_vr_value code_string cs if n_elements da gt 0 then self set_vr_value date da if n_elements ds gt 0 then self set_vr_value decomal_string ds if n_elements dt gt 0 then self set_vr_value date_time dt if n_elements fl gt 0 then self set_vr_value single_floating_point fl if n_elements fd gt 0 then self set_vr_value double_floating_point fd if n_elements is gt 0 then self set_vr_value integer_string is if n_elements lo gt 0 then self set_vr_value long_string lo if n_elements _lt gt 0 then self set_vr_value long_text _lt if n_elements ob gt 0 then self set_vr_value other_byte_string ob if n_elements _of gt 0 then self set_vr_value other_float_string _of if n_elements ow gt 0 then self set_vr_value other_word_string ow if n_elements pn gt 0 then self set_vr_value person_name pn if n_elements sh gt 0 then self set_vr_value short_string sh if n_elements sl gt 0 then self set_vr_value signed_long sl if n_elements sq gt 0 then self set_vr_value sequence_of_items sq if n_elements ss gt 0 then self set_vr_value signed_short ss if n_elements st gt 0 then self set_vr_value short_text st if n_elements tm gt 0 then self set_vr_value time tm if n_elements ui gt 0 then self set_vr_value unique_identifier ui if n_elements ul gt 0 then self set_vr_value unsigned_long ul if n_elements un gt 0 then self set_vr_value unknown un if n_elements us gt 0 then self set_vr_value unsigned_short us if n_elements ut gt 0 then self set_vr_value unlimited_text ut if n_elements av gt 0 then self set_vr_value attribute_values av if n_elements val_only gt 0 then self value_only keyword_set val_only if n_elements cont gt 0 then self wizard_cont cont 0 if n_elements od gt 0 then self outdir od 0 if n_elements nb gt 0 then begin xx keyword_set nb self no_block xx self wizard setproperty no_block xx endif if n_elements ofe gt 0 then begin if strmid ofe 0 1 ne then ofe ofe self outfile_extension ofe 0 endif if n_elements ofp gt 0 then self outfile_prefix ofp 0 if n_elements file gt 0 then begin if self wizard query_wizard_dialog then begin Catch error err 0 catch err if err ne 0 then begin message Invalid Dicom file file continue return endif Generate temporary file ind 0 str anonymous tempfile str 0 dcm while file_test tempfile do begin ind tempfile str strtrim ind 2 dcm endwhile self tempfile tempfile o obj_new idlffdicomex self tempfile clone file self file file obj_destroy self odicom self odicom o catch cancel if n_elements self static_tags gt 0 then self define_tags self static_tags else self reset static if n_elements self dynamic_tags gt 0 then self define_tags self dynamic_tags endif endif end Anonymizer::Wizard Launches the Anonymizer Wizard keyword FROM_ANONYMIZER in type boolean Internal keyword letting Wizard know it has been launched from the Anonymizer::Anonymize method pro anonymizer::wizard from_anonymize fa if file_test self file then return if n_elements self static_tags eq 0 then return self wizard launch_wizard static self static_tags dynamic self dynamic_tags value_only self value_only from_application keyword_set fa end Anonymizer__Define Define the class structure field odicom Instance of the IDLffDicomEx object field dynamic_tags A structure array containing a list of DICOM attribute tags to be anonymized The structures are of the form desc: tag: value: flag:0b This array can be modified by the user field static_tags Structure array of predefined DICOM attribute tags to be anonymized The structures are of the form desc: tag: value: flag:0b Items can not be added or removed from this array field wizard AWizard Object Class for Anonymizer wizard field wizard_cont Used internally field no_block Sets the blocking status of the Anonymizer Wizard field value_only Determines what attibutes are written to the anonymized file If VALUE_ONLY is set to 1 only attribute tags that exist and are defined in the original file are written to the anonymized file If VALUE_ONLY is set to 0 then all tags that exist in the orignal file are written to the anonymized file field file A string containing the name of the DICOM file to be anonymized field outdir Sets the output directory for the anonymized DICOM file field outfile_extension Sets the extension for the anonymized filename field outfile_prefix Sets the prefix for the anonymized filename field attribute_values A structure containing the default attributes being used field default_att_values A structure containing the Anonymizer s default attributes field tempfile Internal field used for storing the temporary filename to which the anonymized file is written field pref_file Internal field containing the name of the user preference file history Written June 2005 : Daryl Atencio pro anonymizer__define Structure for holding default attribute values: attribute_values attribute_values ae: Anonymous Application Entity as: 00 Age String at: 0u 0 Attribute Tag cs: ANONYMOUS Code String da: 19000101 Date ds: Decimal String dt: 19000101000000 Date Time fl: values f_nan Floating Point Single fd: values d_nan Floating Point Double is: Integer String lo: Anonymous Long String _lt: Anonymous Long Text ob:0b Other Byte String _of: values f_nan Other Float String ow:0 Other Word String pn: Anonymous Person Name sh: Anonymous Short String sl:0l Signed Long sq: Sequence of Items ss:0 Signed Short st: Anonymous Short Text tm: 000000 Time ui: Unique Identifier ul:0ul Unsigned Long un:0b Unknown us:0u Unsigned Short ut: Anonymous Unlimited Text void anonymizer IDLffDicomEx object odicom:obj_new IDLffDicom Object dynamic_tags:ptr_new static_tags:ptr_new wizard:obj_new wizard_cont:1 no_block:0b value_only:0b pref_file: file: tempfile: outdir: outfile_extension: outfile_prefix: attribute_values:attribute_values default_att_values:attribute_values end");
var URL = 0;
var FILENAME = 1;
var DESCRIPTION = 2;
var CONTENTS = 3;
var MATCH_TYPE = 4;
var N_MATCHES = 5;
var SCORE = 6;
var i = 7;
var MATCHES = 8;
var html;
var searchString;
var wildcard;
var invalidSearchString;
var origSearchString;
FILENAME_SCORE_ORDER = 0;
URL_SCORE_ORDER = 1;
DESCRIPTION_SCORE_ORDER = 2;
CONTENT_SCORE_ORDER = 3;
SCORE_PER_TYPE = 15000;
var sortResultsByType = true;
var omitDescriptions = false;
var addMatchSummary = true;
var searchTitles = true;
var searchDescriptions = true;
var searchContent = true;
var footer = "";
function isAlnumAmp(ch) {
if ((ch >= "a" && ch <= "z") || (ch == "&") ||(ch >= "A" && ch <= "Z") || (ch >= "0" && ch <="9")) {
return true;
} else {
return false;
}
}
function searchElement(fileNumber, matchType, upperSearchString) {
var element = a[fileNumber][matchType].toUpperCase();
var w, x, y;
var z = 0;
a[fileNumber][N_MATCHES] = 0;
w = element.indexOf(upperSearchString);
while (w >= 0){
z = z + w + 1;
if ((wildcard == -2) || (wildcard == -5)) {
x = false;
} else {
if (w == 0) {
x = false;
} else {
x = isAlnumAmp(element.charAt(w - 1));
}
}
if ((wildcard == -3) || (wildcard == -5)) {
y = false;
} else {
if (element.length - w == upperSearchString.length) {
y = false;
} else {
y = isAlnumAmp(element.charAt(w + upperSearchString.length));
}
}
if (!x && !y) {
a[fileNumber][MATCHES + a[fileNumber][N_MATCHES]] = z - 1;
a[fileNumber][N_MATCHES]++;
}
element = element.substring(w + 1, element.length);
while (isAlnumAmp(element.charAt(0)) && element.length > 0) {
element = element.substring(1, element.length);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -