GithubHelp home page GithubHelp logo

rmsandu / xml-processing Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 965 KB

Repository focused on extracting data from XML log files generated by computer assisted systems used in the OR.

Python 54.28% Jupyter Notebook 44.27% C++ 1.44%
image-guided-therapy medical-image-processing xml-processing data-mining 3d-trajectory-visualization

xml-processing's People

Contributors

rmsandu avatar tri16cc avatar

Watchers

 avatar  avatar

xml-processing's Issues

how do we add multiple registrations?

If multiple registrations have been created at different time points (let's assume by different people) how do we assign them?

Registration belongs to patient hierarchy. One patient can have one or more registrations. A registration is not dependent on a needle trajectory. Issues with ruining the tabular format.

IRE electrode technical extraction from XML

  • add patient id from "patient_information.xml" (in older versions it doesn't appear)

  • check version 2.5 (where no reference needle is defined)

  • check lesion identification algorithm

  • Check validation needle

  • add patient id

  • add patient name

  • according to the clinician: only IRE were done. if MWA appears is actually an IRE electrode, since the option for IRE wasn't available in the early versions of CAS-One IR

Add MWA Needle Extraction

Extract MWA Needle Information

  • TPES
  • EntryPoint, TargetPoint
  • Type of Needle from the Plan
  • which needle for which segmentation
  • extract path to segmentation from XML logs (Plan.xml, Ablation_Validation.xml or Validation.xml)
  • add the ablator Information
  • connect with MWA Needle Database
  • get unique patient id from the XML log
  • match patient id with patient id from segmentations
  • extract date of segmentation from folder name (new CAS version
  • add all info to one main excel file (connect everything somehow)
  • write to Excel
  • fix for ablation_validation.xml new files
  • add path to CT plan and CT validation

Bug when no segmentation exists for tumor/ablation

Or the number of segmentations differs from tumors to ablation.
Scenario 1):
Sometimes the tumor is not visible on the CT scan (only visible on MRI). So it's not possible to segment a tumor if it;s not visible. However, the respective ablation area is visible.
Scenario 2):
No ablation segmentation, but tumor segmentation available. In case of IRE.

  • too many variables unwrapped into one structure. problem either with parsing "needles" either with "segmentations"

UTF Coding Naming Issues

Failure to open XML logs with German/Swedish umlauts.
These are converted to "weird" characters that cannot be interpreted by Untangle library.
Possible solution:

  • open as text, edit the culprit characters.
  • parse with untangle

Angles between Electrode Pairs IRE

  • calculate angles for each electrode pair
  • ignore MWA needles
  • start needle indexing at 1 (when no reference needle available)
  • order lesion nr
  • add euclidean distance

Filename and file path too long

Unzipping fails because the filepath and filename are too long after appending the CT series UID to XML Validation/Plan file (new version starting 2018).

Because of this it cannot be unzipped, nor opened in Python.

Clean Output To Excel File:

  • Update Segmentation Path
  • why do we have redundant information? --> union TPEs and Segmentation Paths based on TP
  • Update Needle and Lesion Nr for MWA
  • Correlate with Lesion Nr (need to extract from RedCAP)
  • clean code for writing to Excel
  • Validate for IREs

Apply Registration Matrix and re-rewrite segmentations

  • do check the spacing of the images & their segmentations
  • re-compute the distance metrics (plots)
  • still open: where to store the segmentations? Write directly on cochlea
  • apply registration matrix on source images
  • apply registration matrix on segmentations

Add Lesion Number for IRE

  • where and Tag available for type = "EG_IRE_Trajectory" or available for type="EG_ATOMIC_TRAJECTORY" (MWA)
  • for CAS Version where Trajectory id="0" and so forth can't tell how many lesions based on the XML solely
  • reset lesion count when date of intervention changes
  • reset lesion count when needle type changes from IRE to MWA
  • improve findLesion fct

Define function to unzip folders

Generally the IR data of the patients is contained in .ZIP folders
At the moment folders are unzipped manually.
For the future define separate function that creates (Temporary) unzipped folder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.