Skip to main content

Import and Export data for Radiomics Workflows.

Project description

lenden

Exchange Workflow Data

  • 📙 lenden for exchange

This library allows to express in a Json format the output of the a Radiomics pipeline.

Installation

To install execute the command

pip install lenden

Use examples

An example pipeline with two outputs results.

from lenden.dataexport  import *

result1= DataResults(Description="Do exercitation occaecat Lorem dolore labore culpa quis.", 
                     Help="Aliquip commodo sunt adipisicing officia irure laborum reprehenderit nulla consectetur in minim.",
                     Type=ResultType.image, Path="/path/to/image", Size=ResultSizeType.normal, Format="%20f")

result2= DataResults(Description="Sit pariatur magna nisi do.", 
                     Help="Velit id adipisicing tempor Lorem. Tempor dolore proident ea quis.",
                     Type=ResultType.percent, Path="/path/to/fileresult", Size=ResultSizeType.wide, Format="RGB(2,3,4)")
# Result without Error
data = DataExport(Version=0.1, HasError=False,
                          DisplayType=DisplayType.grid, Results=[result1, result2],CleanPatterns=['*.tmp'], Logs=None)
print(data.getJSON())

Then the output is:

{
    "Version": 0.1,
    "HasError": false,
    "DisplayType": "grid",
    "Results": [
        {
            "Description": "Do exercitation occaecat Lorem dolore labore culpa quis.",
            "Help": "Aliquip commodo sunt adipisicing officia irure laborum reprehenderit nulla consectetur in minim.",
            "Type": "image",
            "Path": "/path/to/image",
            "Size": "normal",
            "Format": "%20f"
        },
        {
            "Description": "Sit pariatur magna nisi do.",
            "Help": "Velit id adipisicing tempor Lorem. Tempor dolore proident ea quis.",
            "Type": "percent",
            "Path": "/path/to/fileresult",
            "Size": "wide",
            "Format": "RGB(2,3,4)"
        }
    ],
    "CleanPatterns":["*.tmp"],
    "Logs": {
        "Description": "",
        "Path": []
    }
}

If exist an error then

# Result with error
dataWithError = DataExport(Version=0.1, HasError=True,
                          DisplayType=DisplayType.grid, Results=[],CleanPatterns=['*.tmp'],
                          Logs=DataLog("Voluptate sint sint eu aliqua consequat culpa nisi fugiat nostrud aute adipisicing.", 
                                       ["/path/log1","/path/log2","/path/log3"]))
print(dataWithError.getJSON())

Then the output is:

{
    "Version": 0.1,
    "HasError": true,
    "DisplayType": "grid",
    "Results": [],
    "CleanPatterns":["*.tmp"],
    "Logs": {
        "Description": "Voluptate sint sint eu aliqua consequat culpa nisi fugiat nostrud aute adipisicing.",
        "Path": [
            "/path/log1",
            "/path/log2",
            "/path/log3"
        ]
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lenden-0.0.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

lenden-0.0.1.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page