Open tdowrick opened 3 years ago
In GitLab by @RolandGuichard on Jun 11, 2019, 14:34
@ThomasDowrick and @AnastasisGeorgoulas do you have comments/suggestions on this ? I am happy to investigate that solution if you think it worth.
In GitLab by @AnastasisGeorgoulas on Jun 14, 2019, 09:05
Putting the config in /sbn
might be the simplest solution.
I've tried creating a wrapper (leaving the config in the same location) but am still running into the same problem.
I don't think creating an entrypoint would help, because we don't really have an installable package - although we could try installing it for Slicer's python.
In GitLab by @RolandGuichard on Jun 14, 2019, 09:09
Just to be sure, install what in Slicer's Python ?
In GitLab by @AnastasisGeorgoulas on Jun 14, 2019, 09:40
I meant turning our code into a python package (so create a setup.py
) and installing it with pip
. Then I think the imports should work more easily (even without defining an entrypoint).
In GitLab by @RolandGuichard on Jun 14, 2019, 09:43
But wasn't the issue about pipping the crcmode
in Slicer ? I don't see yet how packaging the skullbasenavigation
will solve this (unless I miss something).
In GitLab by @AnastasisGeorgoulas on Jun 14, 2019, 09:46
These are separate issues. Installing crcmod
is a requirement for installing sksurgery-bk
(which in turn would be a requirement of this package, if we make one). But the problem here is with our code finding the configuration file and where to put that.
In GitLab by @RolandGuichard on Jun 14, 2019, 10:11
Yes, sure. But maybe a reasonable mid-point solution, as we discussed, would be to run the pyIGTLink
server as a process in the launcher and leave the config in sbn
. ¯_(ツ)_/¯.
In GitLab by @RolandGuichard on Jun 11, 2019, 14:33
It looks like from here and here that relative imports are impossible when running a top-level script in Python.
This caused us to move the
config.py
fromskullbasenavigation/
tosbn/
which is not ideal.What would be a good workaround this ? Two ideas have emerged:
Since we need some kind of launcher, I was wondering if we could actually come with a solution that would reuse the launch idea and resolve the relative imports ?