Commit ab697eda authored by Mark Hymers's avatar Mark Hymers
Browse files

More import fixes


Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@hankel.co.uk>
parent 07b928f7
Pipeline #1094 passed with stage
in 5 minutes and 1 second
......@@ -4,6 +4,11 @@
import pytest
try:
from pydicom import read_file
except ImportError:
from dicom import read_file
########################################################################
# Empty class tests
########################################################################
......@@ -34,7 +39,6 @@ class TestCaseSeries:
def test_image_noproperty(self):
from os.path import join
from dicom import read_file
from yias.dicom import DICOMSeries
from .test_support import TEST_BASEDIR
......
......@@ -4,13 +4,17 @@
import pytest
try:
from pydicom import read_file
except ImportError:
from dicom import read_file
########################################################################
# Extract data from a single file
########################################################################
class TestPhysioExtraction:
def test_extract_physio_data_from_file(self):
from os.path import join
from dicom import read_file
from .test_support import TEST_BASEDIR
from yias.physio import siemens_physio_extract
......@@ -32,7 +36,6 @@ class TestPhysioExtraction:
def test_extract_physio_data_from_non_physio_file(self):
from os.path import join
from dicom import read_file
from .test_support import TEST_BASEDIR
from yias.physio import siemens_physio_extract
from yias.errors import YIASPhysioConversionError
......@@ -46,7 +49,6 @@ class TestPhysioExtraction:
def test_extract_physio_data_from_non_physio_file(self):
from os.path import join
from dicom import read_file
from .test_support import TEST_BASEDIR
from yias.physio import siemens_physio_extract
from yias.errors import YIASPhysioConversionError
......
......@@ -8,6 +8,11 @@ from os.path import join, isdir, isfile
from tempfile import TemporaryDirectory
try:
from pydicom import read_file
except ImportError:
from dicom import read_file
import pytest
from .test_support import (TEST_BASEDIR, BaseCopyTest,
......@@ -121,8 +126,6 @@ class TestCaseIncomingProcessor(BaseIncomingTest):
def test_incoming_processor_duplicate_instance(self, tmpdir):
from dicom import read_file
from yias.processor import IncomingProcessor
from yias.dicom import IncomingHandler
......@@ -330,8 +333,6 @@ class TestCaseIncomingErrorProcessor(BaseIncomingTest):
]
def test_incoming_processor_error(self, tmpdir):
from dicom import read_file
from yias.processor import IncomingProcessor
from yias.dicom import IncomingHandler
......@@ -366,8 +367,6 @@ class TestCaseIncomingAlreadyExistingProcessor(BaseIncomingTest):
def test_incoming_processor_already(self, tmpdir):
from dicom import read_file
from yias.processor import IncomingProcessor
from yias.dicom import IncomingHandler
......
......@@ -8,6 +8,11 @@ from os.path import join
from tempfile import TemporaryDirectory
try:
from pydicom import read_file
except ImportError:
from dicom import read_file
import pytest
from .test_support import (TEST_BASEDIR, BaseCopyTest,
......@@ -116,7 +121,6 @@ class TestCaseSiemensFMRIMosaicDuplicateImageInstance(BaseCopyTest):
# but a duplicate SOPInstanceUID
@pytest.fixture(autouse=True)
def create_incoming(self, copyincoming):
from dicom import read_file
# Read an existing file and save a copy with a new SOPInstanceUID
fname = 'siemens/12/MR.X.1.2.276.0.7230010.3.1.4.2836010529.1187.1490799878.150091'
d = read_file(join(TEST_BASEDIR, fname))
......@@ -416,7 +420,6 @@ class TestCaseSiemensMixedMosaic(BaseIncomingTest):
# it look like it is in the same series
@pytest.fixture(autouse=True)
def create_incoming(self, copyincoming):
from dicom import read_file
# Read an existing file and save a copy with a new SOPInstanceUID
d = read_file(join(self.idir, 'testmosaic'))
suid = d.SeriesInstanceUID
......
......@@ -6,6 +6,11 @@ from os import symlink, makedirs, listdir, unlink, getenv
from os.path import join
from tempfile import TemporaryDirectory, NamedTemporaryFile
try:
from pydicom import read_file
except ImportError:
from dicom import read_file
import pytest
__all__ = []
......@@ -352,7 +357,6 @@ class BaseStudySeriesTests(BaseIncomingTest):
'create_nifti')
def test_anonymise(self):
from dicom import read_file
for study in self.i.sorted_studies():
for series in study.sorted_series():
seriesUID = series.seriesUID
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment