Skip to content

Commit

Permalink
Merge pull request #139 from I2PC/monotomofixes
Browse files Browse the repository at this point in the history
monotomo fixes
  • Loading branch information
albertmena authored Oct 23, 2023
2 parents 4f163d4 + 906a10c commit 79a21cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions xmipptomo/protocols/protocol_resolution_local_monotomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
MONOTOMO_METHOD_URL = 'http://github.com/I2PC/scipion/wiki/XmippProtMonoTomo'
TOMOGRAM_RESOLUTION_FILE = 'localResolutionTomogram_'
FULL_TOMOGRAM_FILE = 'fullTomogram_'
TOMOGRAMFOLDER = 'tomo_'
HISTOGRAM_RESOLUTION_FILE = 'histogram_resolution_'
BINARY_MASK = 'binarymask'
MRCEXT = '.mrc'
Expand Down Expand Up @@ -152,7 +151,7 @@ def resolutionMonoTomoStep(self, oddTomos, evenTomos, tomId):
tsId = ts.getTsId()

#Defining the output folder
tomoPath = self._getExtraPath(TOMOGRAMFOLDER + tsId)
tomoPath = self._getExtraPath(tsId)
os.mkdir(tomoPath)

#Defining outfiles
Expand Down Expand Up @@ -201,7 +200,7 @@ def createOutputPath(self, filename, tomId, ext):
the path with an extension. Exmaple: filename = 'tomogram_' id = 5, ext = '.mrc'
the output will be tomogram_5.mrc
'''
tomoPath = self._getExtraPath(TOMOGRAMFOLDER + str(tomId))
tomoPath = self._getExtraPath(str(tomId))
fnPath = os.path.join(tomoPath, filename+str(tomId)+ext)
return fnPath

Expand Down
12 changes: 6 additions & 6 deletions xmipptomo/tests/test_protocol_monotomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ def testMonoTomo(self):
maxRes=150,
)
self.launchProtocol(MonoTomo)
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_1/fullTomogram_1.mrc')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx1/fullTomogram_1.mrc')),
"MonoTomo has failed creating the resolution tomogram")
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_1/histogram_resolution_1.xmd')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx1/histogram_resolution_1.xmd')),
"MonoTomo has failed creating the resolution histogram")
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_1/localResolutionTomogram_1.mrc')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx1/localResolutionTomogram_1.mrc')),
"MonoTomo has failed creating the mean tomogram")
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_2/fullTomogram_2.mrc')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx2/fullTomogram_2.mrc')),
"MonoTomo has failed creating the resolution tomogram")
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_2/histogram_resolution_2.xmd')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx2/histogram_resolution_2.xmd')),
"MonoTomo has failed creating the resolution histogram")
self.assertTrue(exists(MonoTomo._getExtraPath('tomo_2/localResolutionTomogram_2.mrc')),
self.assertTrue(exists(MonoTomo._getExtraPath('odd_tomogram_rx2/localResolutionTomogram_2.mrc')),
"MonoTomo has failed creating the mean tomogram")

3 changes: 1 addition & 2 deletions xmipptomo/viewers/viewer_resolution_local_monotomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@

from xmipptomo.protocols.protocol_resolution_local_monotomo import (XmippProtMonoTomo,
TOMOGRAM_RESOLUTION_FILE, FULL_TOMOGRAM_FILE,
HISTOGRAM_RESOLUTION_FILE, TOMOGRAMFOLDER,
MRCEXT, XMDEXT)
HISTOGRAM_RESOLUTION_FILE, MRCEXT, XMDEXT)


class XmippMonoTomoViewer(LocalResolutionViewer):
Expand Down

0 comments on commit 79a21cc

Please sign in to comment.