Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions mapclientplugins/argonsceneexporterstep/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json

from PySide6 import QtGui, QtWidgets, QtCore
from cmlibs.argon.argondocument import ArgonDocument

from mapclient.mountpoints.workflowstep import WorkflowStepMountPoint
from mapclientplugins.argonsceneexporterstep.configuredialog import ConfigureDialog
Expand Down Expand Up @@ -32,9 +33,13 @@ def __init__(self, location):
# Add any other initialisation code here:
self._icon = QtGui.QImage(':/argonsceneexporterstep/images/data-sink.png')
# Ports:
self.addPort(('http://physiomeproject.org/workflow/1.0/rdf-schema#port',
self.addPort([('http://physiomeproject.org/workflow/1.0/rdf-schema#port',
'http://physiomeproject.org/workflow/1.0/rdf-schema#uses',
'https://cmlibs.org/1.0/rdf-schema#ArgonDocument'))
'https://cmlibs.org/1.0/rdf-schema#ArgonDocument'),
('http://physiomeproject.org/workflow/1.0/rdf-schema#port',
'http://physiomeproject.org/workflow/1.0/rdf-schema#uses',
'http://physiomeproject.org/workflow/1.0/rdf-schema#file_location')
])
self.addPort(('http://physiomeproject.org/workflow/1.0/rdf-schema#port',
'http://physiomeproject.org/workflow/1.0/rdf-schema#provides',
'http://physiomeproject.org/workflow/1.0/rdf-schema#directory_location'))
Expand Down Expand Up @@ -103,16 +108,25 @@ def execute(self):
finally:
QtWidgets.QApplication.restoreOverrideCursor()

def setPortData(self, index, dataIn):
def setPortData(self, index, data_in):
"""
Add your code here that will set the appropriate objects for this step.
The index is the index of the port in the port list. If there is only one
uses port for this step then the index can be ignored.

:param index: Index of the port to return.
:param dataIn: The data to set for the port at the given index.
:param data_in: The data to set for the port at the given index.
"""
self._document = dataIn # http://physiomeproject.org/workflow/1.0/rdf-schema#file_location
if isinstance(data_in, str) and os.path.isfile(data_in):
with open(data_in) as fh:
content = fh.read()

document = ArgonDocument()
document.initialiseVisualisationContents()
document.deserialize(content, base_path=os.path.dirname(data_in))
data_in = document

self._document = data_in # http://physiomeproject.org/workflow/1.0/rdf-schema#file_location

def getPortData(self, index):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def readfile(filename, split=False):
readme = readfile("README.rst", split=True)[3:] # skip title
# For requirements not hosted on PyPi place listings
# into the 'requirements.txt' file.
requires = ['PySide6', 'cmlibs.exporter >= 0.6.2'] # minimal requirements listing
requires = ['PySide6', 'cmlibs.exporter >= 0.6.2', 'cmlibs.argon >= 0.5'] # minimal requirements listing
source_license = readfile("LICENSE")


Expand Down