Uploaded image for project: 'The Virtual Brain'
  1. The Virtual Brain
  2. TVB-1604

Improve the way a Cortex objects gets populated from 'readers' in the console interface.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.3
    • Component/s: None
    • Labels:
      None

      Description

      The scenario is related to loading a non-default Cortex datatype:

      import tvb.datatypes.surfaces as surfaces
      #The following line fails even if I'm in the directory where the zip file is
      my_cortex = surfaces.Cortex.from_file("surface_80k.zip")
      #With this one it works
      my_cortex = surfaces.Cortex.from_file(source_file="cortex_80k/surface_80k.zip")
      #But ... the default region mapping is loaded. This shouldn't be the case
      my_cortex.region_mapping.shape
      >>(16384,)

      If I didn't have tvb_data in my pythonpath, then loading from a non-default file will fail because it wouldn't find the default region mapping.

      Possible solutions:

      A) add more keywords?

      my_cortex = surfaces.Cortex.from_file(source_file="cortex_80k/surface_80k.zip",
      region_mapping_file="my_region_mapping",
      local_connectivity_file= "my_local connectivity" )

      B) be able to load the region mapping separately

      my_rm = surfaces.RegionMapping.from_file(source_file="...") my_lc =
      surfaces.LocalConnectivity.from_file(source_file="...")

      and then

      my_cortex = surfaces.Cortex(local_connectivity= my_lc, region_mapping_data=my_rm)
      my_cortex.from_file(source_file = "...")

      this shouldn't overwrite the local connectivity or the region mapping

      C) impose a naming convention on the region mapping and local connectivity files, so when we call

      my_cortex = surfaces.Cortex.from_file(source_file="cortex_80k/surface_80k.zip")

      it will try to see whether there is a file with the string 'region_mapping' and 'local_connectivity'.

      The region mapping is a required attribute of the Cortex dtype, therefore if no file is found, tehre should be an error; the local connectivity is not required, so if none is found no action is taken.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              lia.domide Lia Domide
              Reporter:
              paula.sanz-leon Paula Sanz Leon
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours Time Not Required
                  4h