def testMergeTwoSubWedgesAdjascentInRotationAxis(self): # First check two sub wedges which shouldn't be merged edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge.parseFile( self.__strPathToReferenceInput) xsDataSubWedge1 = xsDataInputSubWedgeMerge.getSubWedge()[0] xsDataSubWedge2 = xsDataInputSubWedgeMerge.getSubWedge()[1] xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeTwoSubWedgesAdjascentInRotationAxis( xsDataSubWedge1, xsDataSubWedge2) EDAssert.equal(xsDataSubWedgeMerged, None) # Then check two adjascent images strPathToInputTwoAdjascentImages = os.path.join( self.getPluginTestsDataHome(), "XSDataInputSubWedgeMerge_twoAdjascentImages.xml") xsDataInputSubWedgeMerge2 = XSDataInputSubWedgeMerge.parseFile( strPathToInputTwoAdjascentImages) xsDataSubWedge1 = xsDataInputSubWedgeMerge2.getSubWedge()[0] xsDataSubWedge2 = xsDataInputSubWedgeMerge2.getSubWedge()[1] xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeTwoSubWedgesAdjascentInRotationAxis( xsDataSubWedge1, xsDataSubWedge2) xsDataSubWedgeMergedReference = XSDataSubWedge.parseFile( os.path.join(self.getPluginTestsDataHome(), "XSDataSubWedgeMerged_twoImages.xml")) EDAssert.equal(xsDataSubWedgeMerged.marshal(), xsDataSubWedgeMergedReference.marshal())
def testMergeTwoSubWedgesAdjascentInRotationAxis(self): # First check two sub wedges which shouldn't be merged edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge.parseFile(self.__strPathToReferenceInput) xsDataSubWedge1 = xsDataInputSubWedgeMerge.getSubWedge()[0] xsDataSubWedge2 = xsDataInputSubWedgeMerge.getSubWedge()[1] xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeTwoSubWedgesAdjascentInRotationAxis(xsDataSubWedge1, xsDataSubWedge2) EDAssert.equal(xsDataSubWedgeMerged, None) # Then check two adjascent images strPathToInputTwoAdjascentImages = os.path.join(self.getPluginTestsDataHome(), "XSDataInputSubWedgeMerge_twoAdjascentImages.xml") xsDataInputSubWedgeMerge2 = XSDataInputSubWedgeMerge.parseFile(strPathToInputTwoAdjascentImages) xsDataSubWedge1 = xsDataInputSubWedgeMerge2.getSubWedge()[0] xsDataSubWedge2 = xsDataInputSubWedgeMerge2.getSubWedge()[1] xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeTwoSubWedgesAdjascentInRotationAxis(xsDataSubWedge1, xsDataSubWedge2) xsDataSubWedgeMergedReference = XSDataSubWedge.parseFile(os.path.join(self.getPluginTestsDataHome(), "XSDataSubWedgeMerged_twoImages.xml")) EDAssert.equal(xsDataSubWedgeMerged.marshal(), xsDataSubWedgeMergedReference.marshal())
def testMergeListOfSubWedgesWithAdjascentRotationAxis(self): edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() # Check a list of nine adjascent images strPathToInputNineAdjascentImages = os.path.join(self.getPluginTestsDataHome(), "XSDataInputSubWedgeMerge_nineAdjascentImages.xml") xsDataInputSubWedgeMergeNine = XSDataInputSubWedgeMerge.parseFile(strPathToInputNineAdjascentImages) xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeListOfSubWedgesWithAdjascentRotationAxis(xsDataInputSubWedgeMergeNine.getSubWedge()) xsDataSubWedgeMergedReference = XSDataSubWedge.parseFile(os.path.join(self.getPluginTestsDataHome(), "XSDataSubWedgeMerged_nineImages.xml")) EDAssert.equal(xsDataSubWedgeMerged[0].marshal(), xsDataSubWedgeMergedReference.marshal())
def testSortSubWedgesOnExperimentalCondition(self): # First check two sub wedges with identical experimental conditions edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge.parseFile(self.__strPathToReferenceInput) edListSubWedgeSorted = edPluginSubWedgeMergev10.sortSubWedgesOnExperimentalCondition(xsDataInputSubWedgeMerge) # Check that we got a list with one element EDAssert.equal(len(edListSubWedgeSorted), 1) # Then modify one sub wedge xsDataSubWedge1 = xsDataInputSubWedgeMerge.getSubWedge()[0] xsDataSubWedge1.getExperimentalCondition().getDetector().setDistance(XSDataLength(300.0)) edListSubWedgeSorted = edPluginSubWedgeMergev10.sortSubWedgesOnExperimentalCondition(xsDataInputSubWedgeMerge) # Check that we got a list with two elements EDAssert.equal(len(edListSubWedgeSorted), 2)
def testMergeListOfSubWedgesWithAdjascentRotationAxis(self): edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() # Check a list of nine adjascent images strPathToInputNineAdjascentImages = os.path.join( self.getPluginTestsDataHome(), "XSDataInputSubWedgeMerge_nineAdjascentImages.xml") xsDataInputSubWedgeMergeNine = XSDataInputSubWedgeMerge.parseFile( strPathToInputNineAdjascentImages) xsDataSubWedgeMerged = edPluginSubWedgeMergev10.mergeListOfSubWedgesWithAdjascentRotationAxis( xsDataInputSubWedgeMergeNine.getSubWedge()) xsDataSubWedgeMergedReference = XSDataSubWedge.parseFile( os.path.join(self.getPluginTestsDataHome(), "XSDataSubWedgeMerged_nineImages.xml")) EDAssert.equal(xsDataSubWedgeMerged[0].marshal(), xsDataSubWedgeMergedReference.marshal())
def testSortSubWedgesOnExperimentalCondition(self): # First check two sub wedges with identical experimental conditions edPluginSubWedgeMergev10 = self.createPlugin() edPluginSubWedgeMergev10.configure() xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge.parseFile( self.__strPathToReferenceInput) edListSubWedgeSorted = edPluginSubWedgeMergev10.sortSubWedgesOnExperimentalCondition( xsDataInputSubWedgeMerge) # Check that we got a list with one element EDAssert.equal(len(edListSubWedgeSorted), 1) # Then modify one sub wedge xsDataSubWedge1 = xsDataInputSubWedgeMerge.getSubWedge()[0] xsDataSubWedge1.getExperimentalCondition().getDetector().setDistance( XSDataLength(300.0)) edListSubWedgeSorted = edPluginSubWedgeMergev10.sortSubWedgesOnExperimentalCondition( xsDataInputSubWedgeMerge) # Check that we got a list with two elements EDAssert.equal(len(edListSubWedgeSorted), 2)