How to use the pypx.base.Base function in pypx

To help you get started, we’ve selected a few pypx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FNNDSC / pypx / pypx / move.py View on Github external
# Global modules
import subprocess

# PYPX modules
from .base import Base

class Move(Base):
    """docstring for Move."""
    def __init__(self, arg):
        super(Move, self).__init__(arg)

    def command(self, opt={}):
        command = '--move ' + opt['aet_listener']
        command += ' --timeout 5'
        command += ' -k QueryRetrieveLevel=SERIES'
        command += ' -k SeriesInstanceUID=' + opt['series_uid']

        return self.executable + ' ' + command + ' ' + self.commandSuffix()

    def run(self, opt={}):
        response = subprocess.run(
            self.command(opt), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
        return self.handle(response)
github FNNDSC / pypx / pypx / find.py View on Github external
# Global modules
import subprocess, re, collections

# PYPX modules
from .base import Base

class Find(Base):
    """docstring for Find."""
    def __init__(self, arg):
        super(Find, self).__init__(arg)
        # to be moved out
        self.postfilter_parameters = {
            'PatientSex': '',
            'PerformedStationAETitle': '',
            'StudyDescription': '',
            'SeriesDescription': ''
        }

    def command(self, opt={}):
        command = '-xi -S'

        return self.executable + ' ' + command + ' ' + self.query(opt) + ' ' + self.commandSuffix()
github FNNDSC / pypx / pypx / echo.py View on Github external
# Global modules
import  subprocess
import  pudb
import  json
import  pfmisc
from    pfmisc._colors      import  Colors

# PYPX modules
from .base import Base

class Echo(Base):
    """
    The 'Echo' class is essentially a stripped down module that 
    simply runs an 'echoscp' on the system shell.
    """

    def __init__(self, arg):
        """
        Constructor.

        Largely simple/barebones constructor that calls the Base()
        and sets up the executable name.
        """

        super(Echo, self).__init__(arg)
        self.dp = pfmisc.debug(
                    verbosity   = self.verbosity,