示例#1
0
    def show3Dimage(self):
        """Generate 3D view button has been pressed"""
        
        print_v("image3D button was clicked.")
        
        self.update_net_sim()
        self.tabs.setCurrentWidget(self.all_tabs[self.IMAGE_3D_TAB])

        from neuromllite.NetworkGenerator import generate_neuroml2_from_network
        
        nml_file_name, nml_doc = generate_neuroml2_from_network(self.network, 
                                   print_summary=True, 
                                   format='xml', 
                                   base_dir=None,
                                   copy_included_elements=False,
                                   target_dir=None,
                                   validate=False,
                                   simulation=self.simulation)
                                          
        post_args = "-png"

        from pyneuroml.pynml import run_jneuroml
        run_jneuroml("", 
                     nml_file_name, 
                     post_args, 
                     verbose = True)
                     
        nml_view_file = nml_file_name.replace('.nml','.png')
                    
        self.add_image(nml_view_file, self.IMAGE_3D_TAB)               
示例#2
0
    def generateNeuroML2(self):
        """Generate NeuroML 2 representation of network"""

        print_v("Generate NeuroML 2 button was clicked.")

        self.update_net_sim()
        from neuromllite.NetworkGenerator import generate_neuroml2_from_network

        nml_file_name, nml_doc = generate_neuroml2_from_network(
            self.network,
            print_summary=True,
            format="xml",
            base_dir=None,
            copy_included_elements=False,
            target_dir=None,
            validate=False,
            simulation=self.simulation,
        )

        with open(nml_file_name, "r") as reader:
            nml_txt = reader.read()

        self.nml2Text.clear()
        self.nml2Text.insertPlainText(nml_txt)

        self.tabs.setCurrentWidget(self.nml2Tab)
示例#3
0
        Input(
            id="stim_%s" % pop,
            input_source=input_source.id,
            population=pop,
            percentage=80,
        ))

new_file = net.to_json_file("%s.json" % net.id)

################################################################################
###   Builds a NeuroML 2 representation, save as XML

format_ = "xml"
nml_file_name, nml_doc = generate_neuroml2_from_network(
    net,
    nml_file_name="%s.net.nml%s" %
    (net.id, ".h5" if format_ == "hdf5" else ""),
    format=format_,
)

from neuromllite import Simulation

record_traces = {"all": "*"}
record_spikes = {"all": "*"}

sim = Simulation(
    id="SimExample5",
    network=new_file,
    duration=500,
    dt=0.025,
    record_traces=record_traces,
    record_spikes=record_spikes,
示例#4
0
for pop in ['L4_PC']:
    net.inputs.append(Input(id='stim_%s'%pop,
                            input_source=input_source.id,
                            population=pop,
                            percentage=80))

new_file = net.to_json_file('%s.json'%net.id)


################################################################################
###   Builds a NeuroML 2 representation, save as XML

format_='xml'
generate_neuroml2_from_network(net, 
                               nml_file_name='%s.net.nml%s'%(net.id, '.h5' if format_=='hdf5' else ''), 
                               format=format_)


from neuromllite import Simulation

sim = Simulation(id='SimExample5',
                 network=new_file,
                 duration='500',
                 dt='0.025',
                 recordTraces={'all':'*'})
                               
                               

################################################################################
###   Run in some simulators