Giter Site home page Giter Site logo

manual_cacs_to_redcap's Introduction

Import Manual CACS measurements performed in Syngo.via to REDCap automatically

Alt text

forthebadge forthebadge

License: MIT Maintenance

This tool can be used automatically import manual Calcium score measurements performed in Syngo.via (Siemens software) to REDCap. Code is adapted according to the available attributes in REDCap (named by us).

Documentation (by Chat GPT)

The documentation below was created by using the prompt

Write documentation for the following code

Introduction

The purpose of this code is to extract information from SR DICOM files and create a DataFrame that can be used to populate a REDCap database. The code uses the libraries Numpy, Pandas, OS, PyDICOM and Collections.

Initialization

The first section of the code imports the necessary libraries and sets some parameters required for the code to execute properly. The path to the folder containing the SR DICOM files and the path to the folder where the txt files should be saved are both set.

Then, the code checks if the folder to save the txt files exists and if it does not, creates the folder.

After that, the code creates a list of files in the folder containing the SR DICOM files and checks if there are multiple files for the same participant. This is to ensure that there are no errors in the code execution.

Function Definition

The code then defines a function "recurse" that takes two arguments, the DICOM file and the path to the txt file to save information. The function loops over the attributes in the DICOM file and extracts specific attributes of interest. If an attribute is a 'Content Sequence', the function is called again to keep looping over the nested attributes. If an attribute is a specific string, it is written to the txt file. If it is a numeric value inside the previous attribute, it is written to the txt file along with its accompanying attribute.

Information Extraction

The code then extracts the information from the SR DICOM files using the function "recurse". The function is called for each SR file in the folder and the information is appended to the txt file for that participant.

DataFrame Creation

The information from the txt files is then added to a DataFrame with the specified columns. The columns are the attributes to be added to the REDCap database.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT License

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.