pynetstim/coordinates.py
def subset(self,by,vals):
        
        """
        subsets the coordinates
        
        Parameters:
        -----------
        
        by: str
             which trait to use for subseting the coordinates; for instance you can use "name" to subset the coordinates
        
        vals: list
             what values to use; for instance you can provide a list of the names
        
        Returns:
        ---------
        An object of class Coords with all the traits from the original coords instance
        
        
        Examples:
        ---------
        coords = Coords(np.array([1,2,3],[3,4,5],[6,7,8]),img_file='anat.nii.gz',name=['c1','c2','c3'],network=['network1','network2','network1'])
        coords_sub = coords.subset('network',['network1'])
        
        """
        
        idx = []
        for val in vals:
            x = np.where(self.__getattribute__(by)==val)[0].tolist()
            idx.extend(x)
            
        idx = np.array(idx)
                
        coords =  self.coordinates['ras_coord'][idx,:]
        
        traits={}
        for trait in self.traits_list:
            traits[trait] = self.__getattribute__(trait)[idx]
        
        return Coords(coords, self.img_file , coord_type='ras', working_dir=self.working_dir, **traits)

        subsets the coordinates
        
        Parameters:
        -----------
        
        by: str
             which trait to use for subseting the coordinates; for instance you can use "name" to subset the coordinates
        
        vals: list
             what values to use; for instance you can provide a list of the names
        
        Returns:
        ---------
        An object of class Coords with all the traits from the original coords instance
        
        
        Examples:
        ---------
        coords = Coords(np.array([1,2,3],[3,4,5],[6,7,8]),img_file='anat.nii.gz',name=['c1','c2','c3'],network=['network1','network2','network1'])
        coords_sub = coords.subset('network',['network1'])
        
        
subsets the coordinates
Parameters.

str
which trait to use for subseting the coordinates; for instance you can use "name" to subset the coordinates

list
what values to use; for instance you can provide a list of the names



An object of class Coords with all the traits from the original coords instance




subsets the coordinates Parameters . str which trait to use for subseting the coordinates ; for instance you can use " name " to subset the coordinates list what values to use ; for instance you can provide a list of the names An object of class Coords with all the traits from the original coords instance
def subset(self,by,vals):
        idx = []
        for val in vals:
            x = np.where(self.__getattribute__(by)==val)[0].tolist()
            idx.extend(x)
        idx = np.array(idx)
        coords =  self.coordinates['ras_coord'][idx,:]
        traits={}
        for trait in self.traits_list:
            traits[trait] = self.__getattribute__(trait)[idx]
        return Coords(coords, self.img_file , coord_type='ras', working_dir=self.working_dir, **traits)
def subset ( self , by , vals ) : idx = [ ] for val in vals : x = np . where ( self . __getattribute__ ( by ) == val ) [ 0 ] . tolist ( ) idx . extend ( x ) idx = np . array ( idx ) coords = self . coordinates [ 'ras_coord' ] [ idx , : ] traits = { } for trait in self . traits_list : traits [ trait ] = self . __getattribute__ ( trait ) [ idx ] return Coords ( coords , self . img_file , coord_type = 'ras' , working_dir = self . working_dir , ** traits )
subsets the coordinates
Parameters:
subsets the coordinates Parameters :
"""
        subsets the coordinates
        
        Parameters:
        -----------
        
        by: str
             which trait to use for subseting the coordinates; for instance you can use "name" to subset the coordinates
        
        vals: list
             what values to use; for instance you can provide a list of the names
        
        Returns:
        ---------
        An object of class Coords with all the traits from the original coords instance
        
        
        Examples:
        ---------
        coords = Coords(np.array([1,2,3],[3,4,5],[6,7,8]),img_file='anat.nii.gz',name=['c1','c2','c3'],network=['network1','network2','network1'])
        coords_sub = coords.subset('network',['network1'])
        
        """
self
by
vals