rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
outbuf.NumCtxItems = c-1 | outbuf.NumCtxItems = c | def process_dcerpc_packet(self, buf): if not isinstance(buf, DCERPC_Header): smblog.debug("got buf, make DCERPC_Header") dcep = DCERPC_Header(buf) else: dcep = buf |
print(some) | def C(some): print(some) return b':'.join(some) | |
try: self.parser.close() except Exception as e: print(e) | def feed(self, data): self.parser.feed(data) try: self.parser.close() except Exception as e: print(e) | |
print("START current %s" % self.client.element) | logger.debug("START current %s" % self.client.element) | def start(self, tag, attrib, nsmap): print("START current %s" % self.client.element) e = etree.Element(tag, attrib, self.__nsmap__) if self.client.xmlroot == None: self.client.xmlroot = e if self.client.element != None: self.client.element.append(e) self.client.element = e self.client.elements.append(e) |
if self.client.element != None: self.client.element.append(e) | else: self.client.elements.append(e) if self.client.element != None: self.client.element.append(e) | def start(self, tag, attrib, nsmap): print("START current %s" % self.client.element) e = etree.Element(tag, attrib, self.__nsmap__) if self.client.xmlroot == None: self.client.xmlroot = e if self.client.element != None: self.client.element.append(e) self.client.element = e self.client.elements.append(e) |
self.client.elements.append(e) | def start(self, tag, attrib, nsmap): print("START current %s" % self.client.element) e = etree.Element(tag, attrib, self.__nsmap__) if self.client.xmlroot == None: self.client.xmlroot = e if self.client.element != None: self.client.element.append(e) self.client.element = e self.client.elements.append(e) | |
print("END current %s" % self.client.element) | logger.debug("END current %s" % (self.client.element, )) | def end(self, tag): print("END current %s" % self.client.element) self.client.elements.pop() self.client.element = self.client.elements[-1] |
self.client.element = self.client.elements[-1] | if len(self.client.elements) == 0: logger.debug("APPENDING to root") self.client.xmlroot.append(self.client.element) self.client.element = None else: self.client.element = self.client.elements[-1] | def end(self, tag): print("END current %s" % self.client.element) self.client.elements.pop() self.client.element = self.client.elements[-1] |
print("CLOSE current %s" % self.client.element) | pass | def close(self): print("CLOSE current %s" % self.client.element) |
print(d) | def handle_established(self): self.state = "connected" n = ElementTree.Element('stream:stream', attrib={ 'xmlns' : 'jabber:client', 'xmlns:stream' :'http://etherx.jabber.org/streams', 'xmlns:sasl' : 'http://www.iana.org/assignments/sasl-mechanisms', 'xmlns:xml' : 'http://www.w3.org/XML/1998/namespace', 'to' : self.serv... | |
print(data) data = data | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print("ROOT IS EMPTY") | logger.warn("ROOT IS EMPTY") | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print("STATE %s" % self.state) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print("AUTH %s" % auth.text) | logger.debug("AUTH %s" % auth.text) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print("digest-md5") | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(cstring) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(chal) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(sasl_data) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
p = challenge.getparent() p.remove(challenge) | challenge.getparent().remove(challenge) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print(d) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
for s in sasl: p = s.getparent() p.remove(s) | sasl[0].getparent().remove(sasl[0]) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print(j.tag) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(bind) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(session) | self.xmlroot.remove(session.getparent()) binds = self.xmlroot.xpath('/stream:stream/jabber:iq/bind:bind', namespaces=self.__nsmap__) for bind in binds: self.xmlroot.remove(bind.getparent()) iqs = self.xmlroot.xpath('/stream:stream/jabber:iq', namespaces=self.__nsmap__) for iq in iqs: self.xmlroot.remove(iq) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
'to' : "%s@%s/%s" % (channel, self.muc, self.username + '-' + self.resource) }) | 'to' : to }) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print("JOIN %s" % d) | logger.info("trying to join %s" % to) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
self.state = "online" | self.state = "join" elif self.state == "join": presences = self.xmlroot.xpath('/stream:stream/jabber:presence', namespaces=self.__nsmap__) for presence in presences: channel = presence.attrib['from'].split('@')[0] to = presence.attrib['to'] me = '%s@%s/%s' % (self.username, self.server, self.resource) if to == me and... | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print("file %s <-> %s" % (md5_hash, my_hash)) | logger.debug("file %s <-> %s" % (md5_hash, my_hash)) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
self.xmlroot.remove(i.getparent().getparent().getparent()) messages = self.xmlroot.xpath('/stream:stream/jabber:message/jabber:body', namespaces=self.__nsmap__) for message in messages: self.xmlroot.remove(message.getparent()) subjects = self.xmlroot.xpath('/stream:stream/jabber:message/jabber:subject', namespaces=s... | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print("removing %s" % i) | logger.debug("unknown/unhandled xml element: removing %s\n%s\n" % (i, etree.tostring(i, pretty_print=True).decode('ascii')) ) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) |
print("DONE %s" % d) | def handle_io_in(self, data): print(data) data = data self.parser.feed(data) | |
print(p) | logger.debug(p) | def __init__(self, server, port, username, password, resource, muc, config): self.muc = muc self.config = config.copy() for e in self.config: self.config[e]['pcre'] = [] for p in self.config[e]['events']: |
print(self.config) | def __init__(self, server, port, username, password, resource, muc, config): self.muc = muc self.config = config.copy() for e in self.config: self.config[e]['pcre'] = [] for p in self.config[e]['events']: | |
print("XMPP-INCIDENT %s" % d) | def report(self, i, to, xmlobj): if self.client is not None and self.client.state != 'online': return m = etree.Element('message', attrib={ 'type' : 'groupchat', 'to' : '%s@%s'% (to, self.muc), '{http://www.w3.org/XML/1998/namespace}lang' : 'en' }) b = etree.Element('body') x = etree.Element('dionaea', attrib={ 'xmlns... | |
print("HOSTS %s %s " % (c.remote.hostname, c.local.host) ) | def report_connection(self, i, to, connection_type, anon=False): c = i.con print("HOSTS %s %s " % (c.remote.hostname, c.local.host) ) | |
self.__packer.pack_long(self.Pointer) self.__packer.pack_long(32) | def pack(self): if isinstance(self.__packer,ndrlib.Packer): # Pointer self.__packer.pack_long(self.Pointer) # pad? maxcount at the end self.__packer.pack_long(32) # MaxCount,needed as the element of NDR array self.__packer.pack_long(self.Entries) # RPC_UNICODE_STRING Name; for i in range(self.Entries): b = samr.RPC_U... | |
print(" i = %i" % i) | def __init__(self, p, c=1): self.__packer = p if isinstance(self.__packer,ndrlib.Packer): self.Data =[] elif isinstance(self.__packer,ndrlib.Unpacker): self.Count = c #specify how many string array print("Count = %i" % self.Count) for i in range(self.Count): print(" i = %i" % i) self.Length = self.__packer.unpack_short... | |
print(" Length = %i" % self.Length) | def __init__(self, p, c=1): self.__packer = p if isinstance(self.__packer,ndrlib.Packer): self.Data =[] elif isinstance(self.__packer,ndrlib.Unpacker): self.Count = c #specify how many string array print("Count = %i" % self.Count) for i in range(self.Count): print(" i = %i" % i) self.Length = self.__packer.unpack_short... | |
print(" MaximumLength = %i" % self.MaximumLength) | def __init__(self, p, c=1): self.__packer = p if isinstance(self.__packer,ndrlib.Packer): self.Data =[] elif isinstance(self.__packer,ndrlib.Unpacker): self.Count = c #specify how many string array print("Count = %i" % self.Count) for i in range(self.Count): print(" i = %i" % i) self.Length = self.__packer.unpack_short... | |
print(" Reference = %i" % self.Reference) | def __init__(self, p, c=1): self.__packer = p if isinstance(self.__packer,ndrlib.Packer): self.Data =[] elif isinstance(self.__packer,ndrlib.Unpacker): self.Count = c #specify how many string array print("Count = %i" % self.Count) for i in range(self.Count): print(" i = %i" % i) self.Length = self.__packer.unpack_short... | |
print(" j = %i" % j) | def __init__(self, p, c=1): self.__packer = p if isinstance(self.__packer,ndrlib.Packer): self.Data =[] elif isinstance(self.__packer,ndrlib.Unpacker): self.Count = c #specify how many string array print("Count = %i" % self.Count) for i in range(self.Count): print(" i = %i" % i) self.Length = self.__packer.unpack_short... | |
class SipSession(object): | class SipCall(connection): | def __startRecording(self): dumpDir = self.__streamDumpFileIn.rsplit('/', 1)[0] |
sipConnection = None def __init__(self, conInfo, rtpPort, inviteHeaders): if not SipSession.sipConnection: logger.critical("SIP connection class variable not set") | def __init__(self, session, conInfo, rtpPort, inviteHeaders): connection.__init__(self,'udp') | def __startRecording(self): dumpDir = self.__streamDumpFileIn.rsplit('/', 1)[0] |
self.__state = SipSession.SESSION_SETUP | self.__session = session self.__state = SipCall.SESSION_SETUP | def __init__(self, conInfo, rtpPort, inviteHeaders): if not SipSession.sipConnection: logger.critical("SIP connection class variable not set") |
g_sipconfig['user'], SipSession.sipConnection.local.host) | g_sipconfig['user'], self.__session.local.host) | def __init__(self, conInfo, rtpPort, inviteHeaders): if not SipSession.sipConnection: logger.critical("SIP connection class variable not set") |
SipSession.sipConnection.sendto(s, (self.__remoteAddress, self.__remoteSipPort)) | self.__session.send(s) | def send(self, s): s += '\n\n' SipSession.sipConnection.sendto(s, (self.__remoteAddress, self.__remoteSipPort)) |
self.__rtpStream = RtpUdpStream(SipSession.sipConnection.local.host, | self.__rtpStream = RtpUdpStream(self.__session.local.host, | def handle_INVITE(self, headers): # Check authentication self.__authenticate(headers) |
if self.__state != SipSession.SESSION_SETUP: | if self.__state != SipCall.SESSION_SETUP: | def handle_ACK(self, headers, body): if self.__state != SipSession.SESSION_SETUP: logger.warn("ACK received but not in session setup mode") |
self.__state = SipSession.ACTIVE_SESSION | self.__state = SipCall.ACTIVE_SESSION | def handle_ACK(self, headers, body): if self.__state != SipSession.SESSION_SETUP: logger.warn("ACK received but not in session setup mode") |
if self.__state != SipSession.ACTIVE_SESSION: | if self.__state != SipCall.ACTIVE_SESSION: | def handle_BYE(self, headers, body): global g_sipconfig |
self.__state = SipSession.NO_SESSION | self.__state = SipCall.NO_SESSION | def handle_BYE(self, headers, body): global g_sipconfig |
class Sip(connection): | class SipServer(connection): | def sendUnauthorized(nonce): msgLines = [] msgLines.append('SIP/2.0 ' + RESPONSE[UNAUTHORIZED]) msgLines.append("Via: " + self.__sipVia) msgLines.append("Max-Forwards: 70") msgLines.append("To: " + self.__sipTo) msgLines.append("From: " + self.__sipFrom) msgLines.append("Call-ID: {}".format(self.__callId)) msgLines.app... |
self.__sessions = {} SipSession.sipConnection = self | self.__callids = {} | def __init__(self): connection.__init__(self, 'udp') |
logger.info("SIP server created") def sendto(self, s, con): | logger.info("SIP Session created") def send(self, s): | def __init__(self): connection.__init__(self, 'udp') |
s, con[0], con[1])) | s, self.remote.host, self.remote.port)) | def sendto(self, s, con): """ Since the dionaea connection class doesn't provide a sendto method it is implemented here. It is needed to other classes (instances) send messages through the SIP connection (particularly instances of SipSession). It is not needed in this class itself because all send calls are in direct r... |
i = incident("dionaea.modules.python.sip.out") i.con = self i.direction = "out" i.msgType = "RESPONSE" i.message = s i.report() | def sendto(self, s, con): """ Since the dionaea connection class doesn't provide a sendto method it is implemented here. It is needed to other classes (instances) send messages through the SIP connection (particularly instances of SipSession). It is not needed in this class itself because all send calls are in direct r... | |
self.remote.host = con[0] self.remote.port = con[1] self.send(s.encode('utf-8')) | self.server.local.host = self.local.host self.server.remote.port = self.local.port self.server.remote.host = self.remote.host self.server.remote.port = self.remote.port self.server.send(s.encode('utf-8')) | def sendto(self, s, con): """ Since the dionaea connection class doesn't provide a sendto method it is implemented here. It is needed to other classes (instances) send messages through the SIP connection (particularly instances of SipSession). It is not needed in this class itself because all send calls are in direct r... |
logger.debug("Currently active sessions: {}".format(self.__sessions)) | logger.debug("Currently active sessions: {}".format(self.__callids)) | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
if callId in self.__sessions: | if callId in self.__callids: | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
newSession = SipSession((self.remote.host, self.remote.port), | newCall = SipCall(self, (self.remote.host, self.remote.port), | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
r = newSession.handle_INVITE(headers) | r = newCall.handle_INVITE(headers) | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
del newSession | del newCall | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
self.__sessions[callId] = newSession | self.__callids[callId] = newCall | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig |
if callId not in self.__sessions: | if callId not in self.__callids: | def sip_ACK(self, requestLine, headers, body): logger.info("Received ACK") |
self.__sessions[callId].handle_ACK(headers, body) | self.__callids[callId].handle_ACK(headers, body) | def sip_ACK(self, requestLine, headers, body): logger.info("Received ACK") |
if callId not in self.__sessions: | if callId not in self.__callids: | def sip_BYE(self, requestLine, headers, body): logger.info("Received BYE") |
self.__sessions[callId].handle_BYE(headers, body) | self.__callids[callId].handle_BYE(headers, body) | def sip_BYE(self, requestLine, headers, body): logger.info("Received BYE") |
del self.__sessions[callId] | del self.__callids[callId] | def sip_BYE(self, requestLine, headers, body): logger.info("Received BYE") |
if callId not in self.__sessions: | if callId not in self.__callids: | def sip_CANCEL(self, requestLine, headers, body): logger.info("Received CANCEL") |
pass | x = ndrlib.Unpacker(p.StubData) PServerName = x.unpack_pointer() ServerName = x.unpack_string() print("ServerName %s" % ServerName) DesiredAccess = x.unpack_long() print("DesiredAccess %i" % DesiredAccess) InVersion = x.unpack_long() print("InVersion %i" % InVersion) PInRevisionInfo = x.unpack_pointer() Revision ... | def handle_Connect5(cls, p): # 3.1.5.1.1 SamrConnect5 (Opnum 64) # # http://msdn.microsoft.com/en-us/library/cc245745%28PROT.10%29.aspx # # long SamrConnect5( # [in, unique, string] PSAMPR_SERVER_NAME ServerName, # [in] unsigned long DesiredAccess, # [in] unsigned long InVersion, # [in, switch_is(InVersion)] SA... |
resumehandle = x.unpack_long() | resumehandle = 0 if resumehandleptr != 0: resumehandle = x.unpack_long() | # typedef struct _SHARE_INFO_1_CONTAINER { |
def timer_cb(): | def timer_cb(watcher, events): | def timer_cb(): # Send our RTP port to the remote host as a 200 OK response to the # remote host's INVITE request logger.debug("getsockname: {}".format(self.__rtpStream.getsockname())) localRtpPort = self.__rtpStream.getsockname()[1] msgLines = [] msgLines.append("SIP/2.0 " + RESPONSE[OK]) msgLines.append("Via: " + se... |
timer_cb, 0) | timer_cb) | def timer_cb(): # Send our RTP port to the remote host as a 200 OK response to the # remote host's INVITE request logger.debug("getsockname: {}".format(self.__rtpStream.getsockname())) localRtpPort = self.__rtpStream.getsockname()[1] msgLines = [] msgLines.append("SIP/2.0 " + RESPONSE[OK]) msgLines.append("Via: " + se... |
self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255 self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255 self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255 | if (self.config): self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255 self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255 self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255 | def ChangeBackgroundColour(self, pubsub_evt): self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255 self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255 self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255 |
print "Hey, you inserted measure point" | def OnInsertLinearMeasurePoint(self, obj, evt): x,y = self.interactor.GetEventPosition() render = self.interactor.FindPokedRenderer(x, y) slice_data = self.get_slice_data(render) slice_number = slice_data.number self.pick.Pick(x, y, 0, render) x, y, z = self.pick.GetPickPosition() if self.pick.GetViewProp(): print "Hey... | |
print "Hey, you inserted a angular point" | def OnInsertAngularMeasurePoint(self, obj, evt): print "Hey, you inserted a angular point" x,y = self.interactor.GetEventPosition() render = self.interactor.FindPokedRenderer(x, y) slice_data = self.get_slice_data(render) slice_number = slice_data.number self.pick.Pick(x, y, 0, render) x, y, z = self.pick.GetPickPositi... | |
renderer = self.renderers_by_slice_number[n] for actor in actors: renderer.AddActor(actor) | try: renderer = self.renderers_by_slice_number[n] for actor in actors: renderer.AddActor(actor) except KeyError: pass | def AddActors(self, pubsub_evt): "Inserting actors" actors, n = pubsub_evt.data renderer = self.renderers_by_slice_number[n] for actor in actors: renderer.AddActor(actor) try: self.actors_by_slice_number[n].extend(actors) except KeyError: self.actors_by_slice_number[n] = list(actors) |
print "_load_measurements" | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "m:", m.name | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "linear" | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "angular" | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "point:", point | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "actors:", actors | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) f... | |
print "--- actors", actors | def _add_point(self, pubsub_evt): position = pubsub_evt.data[0] type = pubsub_evt.data[1] # Linear or Angular location = pubsub_evt.data[2] # 3D, AXIAL, SAGITAL, CORONAL try: slice_number = pubsub_evt.data[3] except IndexError: slice_number = 0 | |
imagedata, dicom = self.OpenDicomGroup(group, 0, gui=True) | imagedata, dicom = self.OpenDicomGroup(group, 0, [0,0],gui=True) | def ImportMedicalImages(self, directory): # OPTION 1: DICOM? patients_groups = dcm.GetDicomGroups(directory) if len(patients_groups): group = dcm.SelectLargerDicomGroup(patients_groups) imagedata, dicom = self.OpenDicomGroup(group, 0, gui=True) self.CreateDicomProject(imagedata, dicom) # OPTION 2: ANALYZE? else: imaged... |
reader = gdcm.Reader() | reader = gdcm.ImageReader() | def run(self): |
data_dict['invesalius'] = {'orientation_label' : GetImageOrientationLabel(self.filepath)} | data_dict['invesalius'] = {'orientation_label' : label} | def run(self): |
def GetImageOrientationLabel(filename): """ Return Label regarding the orientation of an image. (AXIAL, SAGITTAL, CORONAL, OBLIQUE or UNKNOWN) """ gdcm_reader = gdcm.ImageReader() gdcm_reader.SetFileName(filename) img = gdcm_reader.GetImage() direc_cosines = img.GetDirectionCosines() orientation = gdcm.Orientation() t... | def run(self): | |
self.cursor_.Show(1) | def OnScrollBar(self, evt=None): pos = self.scroll.GetThumbPosition() self.set_slice_number(pos) #self.UpdateSlice3D(pos) self.pos = pos self.cursor_.Show(1) self.interactor.Render() if evt: evt.Skip() | |
self.mode = const.MODE_RP | def CloseProject(self): import constants as const debug("Session.CloseProject") self.project_path = () self.project_status = const.PROJ_CLOSE self.mode = const.MODE_RP self.temp_item = False | |
self.last_mask_index = 0 | def __init__(self): # Patient/ acquistion information self.name = '' self.dicom_sample = '' self.modality = '' self.original_orientation = '' self.min_threshold = '' self.max_threshold = '' self.window = '' self.level = '' | |
self.SelectedObject.DoSlide(slide) | if isinstance(self.SelectedObject, SliderControl): self.SelectedObject.DoSlide(slide) else: self.SelectedObject.SetPosition(x) | def OnMotion(self, e): """ This is where the slide occurs ... """ x = e.GetX() # but the user must be dragging a selected object if e.Dragging() and self.SelectedObject: slide = x - self.MousePositionX self.MousePositionX += slide self.SetCursor(self.SelectedObject.GetCursor()) self.SelectedObject.DoSlide(slide) self.S... |
self.last_surface_index = -1 | def __init__(self): # Patient/ acquistion information self.name = '' self.dicom_sample = '' self.modality = '' self.original_orientation = '' self.min_threshold = '' self.max_threshold = '' self.window = '' self.level = '' | |
self.M = bases[0] self.Minv = bases[1] self.N = bases[2] self.Ninv = bases[3] self.q1 = bases[4] self.q2 = bases[5] | self.Minv = bases[0] self.N = bases[1] self.q1 = bases[2] self.q2 = bases[3] | def __init__(self, bases, flag): threading.Thread.__init__(self) self.M = bases[0] self.Minv = bases[1] self.N = bases[2] self.Ninv = bases[3] self.q1 = bases[4] self.q2 = bases[5] self.flag = flag self._pause_ = 0 self.start() |
coord_cam = float(img[0]), float(img[1]), float(img[2]) ps.Publisher().sendMessage('Set ball reference position based on bound', coord_cam) ps.Publisher().sendMessage('Set camera in volume', coord_cam) wx.CallAfter(ps.Publisher().sendMessage, 'Render volume viewer') wx.CallAfter(ps.Publisher().sendMessage, 'Co-register... | def run(self): #Image limits to use in simulation #bounds = array(project.Project().imagedata.GetBounds()) #im_simu = bounds #im_simu[0] = bounds[0] - 10.0 #im_simu[2] = bounds[2] - 10.0 #im_simu[4] = bounds[4] - 10.0 while self.flag == True: #Neuronavigation with Polhemus trck = self.Coordinates() tracker = matrix([[... | |
if dialog.ShowModal() == wx.ID_OK: | try: if dialog.ShowModal() == wx.ID_OK: ok = 1 else: ok = 0 except(wx._core.PyAssertionError): ok = 1 if (ok): | def OnLinkNewSurface(self, evt=None): #import gui.dialogs as dlg dialog = dlg.NewSurfaceDialog(self, -1, _('InVesalius 3 - New surface')) if dialog.ShowModal() == wx.ID_OK: # Retrieve information from dialog (mask_index, surface_name, surface_quality, fill_holes,\ keep_largest) = dialog.GetValue() |
shutil.copy(self.dicom_sample.parser.filename, os.path.join(dir_temp, 'sample.dcm')) | sample_path = os.path.join(dir_temp, 'sample.dcm') shutil.copy(self.dicom_sample.parser.filename,sample_path) os.chmod(sample_path, stat.S_IREAD|stat.S_IWRITE) | def SavePlistProject(self, dir_, filename): |
stripper.SetInput(clean.GetOutput()) | stripper.SetInput(polydata) | def AddNewActor(self, pubsub_evt): """ Create surface actor, save into project and send it to viewer. """ matrix, filename_img, mask, spacing = pubsub_evt.data min_value, max_value = mask.threshold_range fill_holes = True |
if dlg.ShowModal() == wx.ID_OK: | try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() ok = 1 else: ok = 0 except(wx._core.PyAssertionError): | def ShowSaveAsProjectDialog(default_filename=None): current_dir = os.path.abspath(".") dlg = wx.FileDialog(None, _("Save project as..."), # title "", # last used directory default_filename, _("InVesalius project (*.inv3)|*.inv3"), wx.SAVE|wx.OVERWRITE_PROMPT) #dlg.SetFilterIndex(0) # default is VTI filename = None if ... |
def __bind_events_wx(self): self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) self.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.OnEditLabel) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected) def OnItemSelected(self, evt): | def OnItemSelected_(self, evt): | def __bind_events_wx(self): self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) self.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.OnEditLabel) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.