Dump dicom info to an excel file

  • Hi , first of all Thanks to Marcel for this great tool!!!
    Mi question is I need to dump some dicom info of all database patients ( patname ,Kv, Ma, exposureTime....) for statistical reasons and make avalaible to use it in an excel file ( to make statistical desviation and calculate averages for some parameters)
    I was thinking to use exporconverters but I´m nor sure how ,or may be It would be possible straigth from query to Mysql (in this case I´m absolutely lost how to handle it :( )
    If somebody can give me a tip It would be apreciated
    Thanks in advance!

  • Hi,


    if the information is in the database, you could query it in different ways. But if it is not, you are stuck. I would edit the database definition and regenerate it. Is this for a patient dose estimation project? I have a modified dicom.sql for that.


    Marcel

  • Rigth it´s for dose awarenes I´ve got 50 DVDs and need to dump those dicom info to compare (the info is of course in the dicom header) between the same kind of procedure and the differents technical exposure data ,and every DVD has about 400 patients so ... manually it´s a nigthmare to open every patien dump the dicom header and copy and paste into excel or other application to get statistical results
    Cause of that I was wandering if dragging and drop the DVD into conquest window and using exporconverters could be done in some way
    Any suggestion?
    Thanks in advance

  • Hi,


    off course, if the data is not yet in the server, you can use an ExportConverter with as many tags as you like:


    ExportConverter = 1
    ExportConverter0 = append "%V0010,0010[tab]%Vxxxx,yyyy%n" to summary.file


    If you want a tab separated file, you will have to enter the tabs into dicom,ini as hard tabs, there is not alias character for a tab yet.


    If the data is in the server you can use an updated dicom.sql with items for dose awareness. If you edit or replace your dicom.sql YOU ALWAYS HAVE TO REGERENERATE THE DATABASE. Failure to do so, will cripple the server.


    The below definition is denormalized for dbaseIII use.


    You can then use your favorite database tool or even the (terse) dgate --query command to query the database.


    Marcel


  • Hi Marcel I added the exportconverter you sended and got this error message
    ---------------------------------------------------
    ------------ Adding image files to server -----------
    ---- Processing directory: E:\287974220090724
    ---- Processing directory: E:\287974220090724\105416328000
    ---- Processing directory: E:\287974220090724\105416328000\im_1
    [CONQUESTSRV1] ***[AddImageFile] E:\287974220090724\105416328000\im_1\1.3.46.670589.30.1.3.1.1625105436.1248425756484.1 -FAILED: file does not contain correct UIDs
    [CONQUESTSRV1] FreeStore Left 2523 on D:\
    [CONQUESTSRV1] Added file: D:\imagenes\2879742\1.3.46.670589.30.1.3.1.1625105436.1248425756484.1_0001_000001_12525837130005.v2
    -----------------------------------------------------
    -----------------------------------------------------
    Sure I miss something
    Any clue What I´ve done wrong?
    Thanks in advance

  • Hi Marcel , thanks for the support.
    finally I used your dicom.sql and Mysql query/browser and got it! , it´s perfect cause just click on rigth button and the results are sended to excel file .
    Due to I needed some more tags to do my query I modified your file.
    here is my modified dicom.sql , this is mainly for plain x-ray systems (bucky systems) .
    Thanks again for your help!!!!!
    With kind regards


    [ DICOM Database layout
    # Example version for all SQL servers (mostly normalized)
    #
    # (File DICOM.SQL)
    # ** DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING **
    #
    # Version with modality moved to the series level and EchoNumber in image table
    # Revision 3: Patient birthday and sex, bolus agent, correct field lengths
    # Revision 4: Studymodality, Station and Department in study
    # Manufacturer, Model, BodyPart and Protocol in series
    # Acqdate/time, coil, acqnumber, slicelocation and pixel info in images
    # Notes for revision 4:
    # InstitutionalDepartmentName in study (should officially be in series, but eFilm expects it in study)
    # StationName is in study (should officially be in series, but more useful in study)
    # Revision 5: Added patientID in series and images for more efficient querying
    # Revision 6: Added frame of reference UID in series table
    # Revision 7: Added ImageType in image table, StudyModality to 64 chars, AcqDate to SQL_C_DATE
    # Revision 8: Denormalized study table (add patient ID, name, birthdate) to show consistency problems
    # Revision 10: Fixed width of ReceivingCoil: to 16 chars
    # Revision 13: Added ImageID to image database
    # Revision 14: Added WorkList database with HL7 tags
    # Revision 16: Moved Stationname and InstitutionalDepartmentName to series table
    # Revision 17: EchoNumber, ReqProcDescription to 64 characters; StudyModality, EchoNumber, ImageType to DT_MSTR; use Institution instead of InstitutionalDepartmentName
    #
    #
    # 5 databases need to be defined:
    #
    # *Patient*
    # *Study*
    # *Series*
    # *Image*
    # *WorkList*
    #
    #
    # The last defined element of Study is a link back to Patient
    # The last defined element of Series is a link back to Study
    # The last defined element of Image is a link back to Series
    #
    #
    # Format for DICOM databases :
    # { Group, Element, Column Name, Column Length, SQL-Type, DICOM-Type }
    # Format for Worklist database :
    # { Group, Element, Column Name, Column Length, SQL-Type, DICOM-Type, HL7 tag}
    # HL7 tags include SEQ.N, SEQ.N.M, SEQ.N.DATE, SEQ.N.TIME, *AN, *UI
    */
    *Patient*
    {
    { 0x0010, 0x0020, "PatientID", 64, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0010, "PatientName", 64, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0030, "PatientBirthDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0010, 0x0040, "PatientSex", 16, SQL_C_CHAR, DT_STR }
    }


    *Study*
    {
    { 0x0020, 0x000d, "StudyInstanceUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0008, 0x0020, "StudyDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0030, "StudyTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0020, 0x0010, "StudyID", 16, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1030, "StudyDescription", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0050, "AccessionNumber", 16, SQL_C_CHAR, DT_STR },


    { 0x0008, 0x0090, "ReferPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0032, 0x1032, "ReqPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0080, "Institution", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1040, "Department", 64, SQL_C_CHAR, DT_STR },


    { 0x0010, 0x1010, "PatientsAge", 16, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x1030, "PatientsWeight", 16, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0061, "StudyModality", 64, SQL_C_CHAR, DT_MSTR },


    { 0x0010, 0x0010, "PatientName", 64, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0030, "PatientBirthDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0010, 0x0040, "PatientSex", 16, SQL_C_CHAR, DT_STR }


    { 0x0010, 0x0020, "PatientID", 64, SQL_C_CHAR, DT_STR }
    }


    *Series*
    {
    { 0x0020, 0x000e, "SeriesInstanceUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0020, 0x0011, "SeriesNumber", 12, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0021, "SeriesDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0031, "SeriesTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0008, 0x103e, "SeriesDescription", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0060, "Modality", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x5100, "PatientPosition", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0010, "ContrastBolusAgent", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0070, "Manufacturer", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1090, "ModelName", 64, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0015, "BodyPartExamined", 64, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1030, "ProtocolName", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1010, "StationName", 16, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0080, "Institution", 64, SQL_C_CHAR, DT_STR },
    { 0x0020, 0x0052, "FrameOfReferenceUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0010, 0x0020, "SeriesPat", 64, SQL_C_CHAR, DT_STR },


    { 0x0010, 0x0010, "PatientName", 64, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0030, "PatientBirthDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0010, 0x0040, "PatientSex", 16, SQL_C_CHAR, DT_STR }


    { 0x0008, 0x0020, "StudyDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0030, "StudyTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0020, 0x0010, "StudyID", 16, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1030, "StudyDescription", 64, SQL_C_CHAR, DT_STR },


    { 0x0008, 0x0090, "ReferPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0032, 0x1032, "ReqPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1040, "Department", 64, SQL_C_CHAR, DT_STR },


    { 0x0020, 0x000d, "StudyInstanceUID", 64, SQL_C_CHAR, DT_UI }
    }


    *Image*
    {
    { 0x0008, 0x0018, "SOPInstanceUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0008, 0x0016, "SOPClassUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0020, 0x0013, "ImageNumber", 12, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0086, "EchoNumber", 64, SQL_C_CHAR, DT_MSTR },
    { 0x0028, 0x0008, "NumberOfFrames", 12, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0022, "AcqDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0032, "AcqTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0018, 0x1250, "ReceivingCoil", 16, SQL_C_CHAR, DT_STR },
    { 0x0020, 0x0012, "AcqNumber", 12, SQL_C_CHAR, DT_STR },
    { 0x0020, 0x1041, "SliceLocation", 16, SQL_C_CHAR, DT_STR },
    { 0x0028, 0x0002, "SamplesPerPixel", 5, SQL_C_CHAR, DT_UINT16 },
    { 0x0028, 0x0004, "PhotoMetricInterpretation", 16, SQL_C_CHAR, DT_STR },
    { 0x0028, 0x0010, "Rows", 5, SQL_C_CHAR, DT_UINT16 },
    { 0x0028, 0x0011, "Colums", 5, SQL_C_CHAR, DT_UINT16 },
    { 0x0028, 0x0101, "BitsStored", 5, SQL_C_CHAR, DT_UINT16 },
    { 0x0008, 0x0008, "ImageType", 128, SQL_C_CHAR, DT_MSTR },
    { 0x0054, 0x0400, "ImageID", 16, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0020, "ImagePat", 64, SQL_C_CHAR, DT_STR },


    { 0x0018, 0x0050, "SliceThickness", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0072, "EffectiveDuration", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0090, "DataCollectionDiameter", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1151, "XRayTubeCurrent", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1154, "AvgPulseWidth", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1155, "RadiationSetting", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x115e, "RadiationMode", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1170, "GeneratorPower", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1181, "CollimationType", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1302, "ScanLength", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x9311, "SpiralPitchFactor", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x9306, "SingleCollimationWidth", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x9307, "TotalCollimationWidth", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x9323, "ExposureModulationType", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x9305, "RevolutionTime", 16, SQL_C_CHAR, DT_STR },
    { 0x0020, 0x0032, "ImagePositionPatient", 64, SQL_C_CHAR, DT_STR },


    { 0x0018, 0x0015, "BodyPartExamined", 64, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1030, "ProtocolName", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0070, "Manufacturer", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1090, "ModelName", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0090, "ReferPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0032, 0x1032, "ReqPhysician", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0080, "Institution", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x1040, "Department", 64, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0010, "ContrastBolusAgent", 64, SQL_C_CHAR, DT_STR },


    { 0x0010, 0x0010, "PatientName", 64, SQL_C_CHAR, DT_STR },
    { 0x0010, 0x0030, "PatientBirthDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0010, 0x0040, "PatientSex", 16, SQL_C_CHAR, DT_STR }


    { 0x0008, 0x1030, "StudyDescription", 64, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x0060, "KVP", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1153, "MicroMas", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x8150, "texpMicroseg", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1150, "ExposureTime", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1152, "Exposure", 16, SQL_C_CHAR, DT_STR },

    { 0x0018, 0x1405, "RelXrayexposure", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x115e, "areadoseproduct", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1166, "rbucky", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1110, "sid", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1700, "colimationtype", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1702, "Colvleft", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1704, "Colvrigth", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1706, "Colhsup", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x1708, "Colhinf", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x5101, "Posdevisualizacion", 16, SQL_C_CHAR, DT_STR },

    { 0x0008, 0x0023, "ImageDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0033, "ImageTime", 16, SQL_C_CHAR, DT_TIME },


    { 0x0020, 0x000d, "StudyInstanceUID", 64, SQL_C_CHAR, DT_UI },
    { 0x0008, 0x0020, "StudyDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0030, "StudyTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0020, 0x0010, "StudyID", 16, SQL_C_CHAR, DT_STR },


    { 0x0020, 0x0011, "SeriesNumber", 12, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0021, "SeriesDate", 8, SQL_C_DATE, DT_DATE },
    { 0x0008, 0x0031, "SeriesTime", 16, SQL_C_CHAR, DT_TIME },
    { 0x0008, 0x103e, "SeriesDescription", 64, SQL_C_CHAR, DT_STR },
    { 0x0008, 0x0060, "Modality", 16, SQL_C_CHAR, DT_STR },
    { 0x0018, 0x5100, "PatientPosition", 16, SQL_C_CHAR, DT_STR },
    { 0x0020, 0x0052, "FrameOfReferenceUID", 64, SQL_C_CHAR, DT_UI },


    { 0x0020, 0x000e, "SeriesInstanceUID", 64, SQL_C_CHAR, DT_UI }
    }


    *WorkList*
    {
    { 0x0008, 0x0050, "AccessionNumber", 16, SQL_C_CHAR, DT_STR, "OBR.3" },
    { 0x0010, 0x0020, "PatientID", 64, SQL_C_CHAR, DT_STR, "PID.4" },
    { 0x0010, 0x0010, "PatientName", 64, SQL_C_CHAR, DT_STR, "PID.5" },
    { 0x0010, 0x0030, "PatientBirthDate", 8, SQL_C_DATE, DT_DATE, "PID.7" },
    { 0x0010, 0x0040, "PatientSex", 16, SQL_C_CHAR, DT_STR, "PID.8" },


    { 0x0010, 0x2000, "MedicalAlerts", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0010, 0x2110, "ContrastAllergies", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0020, 0x000d, "StudyInstanceUID", 64, SQL_C_CHAR, DT_UI, "---" },
    { 0x0032, 0x1032, "ReqPhysician", 64, SQL_C_CHAR, DT_STR, "OBR.16" },
    { 0x0032, 0x1060, "ReqProcDescription", 64, SQL_C_CHAR, DT_STR, "OBR.4.1" },


    { 0x0040, 0x0100, "--------", 0, SQL_C_CHAR, DT_STARTSEQUENCE, "---" },
    { 0x0008, 0x0060, "Modality", 16, SQL_C_CHAR, DT_STR, "OBR.21" },
    { 0x0032, 0x1070, "ReqContrastAgent", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0001, "ScheduledAE", 16, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0002, "StartDate", 8, SQL_C_DATE, DT_DATE, "OBR.7.DATE" },
    { 0x0040, 0x0003, "StartTime", 16, SQL_C_CHAR, DT_TIME, "OBR.7.TIME" },
    { 0x0040, 0x0006, "PerfPhysician", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0007, "SchedPSDescription", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0009, "SchedPSID", 16, SQL_C_CHAR, DT_STR, "OBR.4" },
    { 0x0040, 0x0010, "SchedStationName", 16, SQL_C_CHAR, DT_STR, "OBR.24" },
    { 0x0040, 0x0011, "SchedPSLocation", 16, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0012, "PreMedication", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0400, "SchedPSComments", 64, SQL_C_CHAR, DT_STR, "---" },
    { 0x0040, 0x0100, "---------", 0, SQL_C_CHAR, DT_ENDSEQUENCE, "---" },


    { 0x0040, 0x1001, "ReqProcID", 16, SQL_C_CHAR, DT_STR, "OBR.4.0" },
    { 0x0040, 0x1003, "ReqProcPriority", 16, SQL_C_CHAR, DT_STR, "OBR.27 }
    }


    ]

  • Hi,
    Im trying to do a similar thing with CT dose structured reports from GE.
    Im sending the SR from the scanner to Conquest. I have been trying to use an import converter to extract the DLP from 0040,A30A. Only problem is this tag is mentioned multiple times and each time contains different information. So far I have only been able to extract the first mention of the tag using the following


    ImportConverter0 = append "%V*0040,A30A%N" to ctdlp.csv


    The only one I need is the total dose but have not been able to get the import converter working.


    Any help would be much appreciated. I can include a sample SR if needed.


    Matt

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!