text
stringlengths
81
112k
Visitor method for Need-node of builder 'html'. Does only wrap the Need-content into an extra <div> with class=need def html_visit(self, node): """ Visitor method for Need-node of builder 'html'. Does only wrap the Need-content into an extra <div> with class=need """ self.body.append(self.start...
Add any extra options introduced via options_ext to needs_info def merge_extra_options(self, needs_info): """Add any extra options introduced via options_ext to needs_info""" extra_keys = set(self.options.keys()).difference(set(needs_info.keys())) for key in extra_keys: needs_info[k...
Add all global defined options to needs_info def merge_global_options(self, needs_info): """Add all global defined options to needs_info""" global_options = getattr(self.env.app.config, 'needs_global_options', None) if global_options is None: return for key, value in global_...
Determines the title for the need in order of precedence: directive argument, first sentence of requirement (if `:title_from_content:` was set, and '' if no title is to be derived. def _get_full_title(self): """Determines the title for the need in order of precedence: directive argument...
Replace all needlist nodes with a list of the collected needs. Augment each need with a backlink to the original location. def process_needlist(app, doctree, fromdocname): """ Replace all needlist nodes with a list of the collected needs. Augment each need with a backlink to the original location. ...
Parse a string formatted X[.Y.Z] version number into a tuple >>> parse_version('10.2.3') (10, 2, 3) >>> parse_version('12') (12, 0, 0) def parse_version(version: str) -> tuple: """Parse a string formatted X[.Y.Z] version number into a tuple >>> parse_version('10.2.3') (10, 2, 3) >>>...
Parse a tablename into tuple(<schema>, <table>). Schema defaults to doc if the table name doesn't contain a schema. >>> parse_table('x.users') ('x', 'users') >>> parse_table('users') ('doc', 'users') def parse_table(fq_table: str) -> Tuple[str, str]: """Parse a tablename into tuple(<schema>,...
Group a iterable of (stmt, args) by stmt into (stmt, bulk_args). bulk_args will be a list of the args grouped by stmt. len(bulk_args) will be <= bulk_size def as_bulk_queries(queries, bulk_size): """Group a iterable of (stmt, args) by stmt into (stmt, bulk_args). bulk_args will be a list of the args...
Create an iterator that returns the lines of a utf-8 encoded file. def get_lines(filename: str) -> Iterator[str]: """Create an iterator that returns the lines of a utf-8 encoded file.""" if filename.endswith('.gz'): with gzip.open(filename, 'r') as f: for line in f: yield li...
Create an iterator that transforms lines into sql statements. Statements within the lines must end with ";" The last statement will be included even if it does not end in ';' >>> list(as_statements(['select * from', '-- comments are filtered', 't;'])) ['select * from t'] >>> list(as_statements(['...
Break a iterable on the item that matches the predicate into lists. The item that matched the predicate is not included in the result. >>> list(break_iterable([1, 2, 3, 4], lambda x: x == 3)) [[1, 2], [4]] def break_iterable(iterable, pred): """Break a iterable on the item that matches the predicate ...
Create a Bag out of given files. :param str dir_bag: Directory that contains csv, jsonld, and changelog files. :return obj: Bag def create_bag(dir_bag): """ Create a Bag out of given files. :param str dir_bag: Directory that contains csv, jsonld, and changelog files. :return obj: Bag """ ...
Open Bag at the given path :param str dir_bag: Path to Bag :return obj: Bag def open_bag(dir_bag): """ Open Bag at the given path :param str dir_bag: Path to Bag :return obj: Bag """ logger_bagit.info("enter open_bag") try: bag = bagit.Bag(dir_bag) logger_bagit.info(...
Check if Bag is valid :param obj bag: Bag :return None: def validate_md5(bag): """ Check if Bag is valid :param obj bag: Bag :return None: """ logger_bagit.info("validate_md5") if bag.is_valid(): print("Valid md5") # for path, fixity in bag.entries.items(): #...
Check DOI flag in bag.info to see if doi_resolver has been previously run :param obj bag: Bag :return bool: Flag def resolved_flag(bag): """ Check DOI flag in bag.info to see if doi_resolver has been previously run :param obj bag: Bag :return bool: Flag """ if 'DOI-Resolved' in bag.info...
Closing steps for creating a bag :param obj dir_bag: :return None: def finish_bag(dir_bag): """ Closing steps for creating a bag :param obj dir_bag: :return None: """ logger_bagit.info("enter finish_bag") # Create a bag for the 3 files new_bag = create_bag(dir_bag) open_bag(...
Ask user if they want to load in one file or do a batch process of a whole directory. Default to batch "m" mode. :return str: Path or none def _ask_how_many(): """ Ask user if they want to load in one file or do a batch process of a whole directory. Default to batch "m" mode. :return str: Path or none ...
Open up a GUI browse dialog window and let to user pick a target directory. :return str: Target directory path def browse_dialog_dir(): """ Open up a GUI browse dialog window and let to user pick a target directory. :return str: Target directory path """ _go_to_package() logger_directory.in...
Open up a GUI browse dialog window and let to user select one or more files :return str _path: Target directory path :return list _files: List of selected files def browse_dialog_file(): """ Open up a GUI browse dialog window and let to user select one or more files :return str _path: Target direct...
Check if the target file has an older creation date than X amount of time. i.e. One day: 60*60*24 :param str filename: Target filename :param int days: Limit in number of days :return bool: True - older than X time, False - not older than X time def check_file_age(filename, days): """ Check if ...
Collect all files from a given path. Separate by file type, and return one list for each type If 'files' contains specific :param str cwd: Directory w/ target files :param list new_files: Specific new files to load :param dict existing_files: Files currently loaded, separated by type :return list: A...
Create the file metadata and add it to the appropriate section by file-type :param str full_path: :param dict existing_files: :return dict existing files: def collect_metadata_file(full_path): """ Create the file metadata and add it to the appropriate section by file-type :param str full_path: ...
Moves JSON and csv files to bag root, then deletes all the metadata bag files. We'll be creating a new bag with the data files, so we don't need the other text files and such. :param str dir_bag: Path to root of Bag :param str dir_data: Path to Bag /data subdirectory :return None: def dir_cleanup(dir_b...
Extract the file name from a given file path. :param str path: File path :return str: File name with extension def filename_from_path(path): """ Extract the file name from a given file path. :param str path: File path :return str: File name with extension """ head, tail = ntpath.split(p...
Search for the directory containing jsonld and csv files. chdir and then quit. :return none: def find_files(): """ Search for the directory containing jsonld and csv files. chdir and then quit. :return none: """ _dir = os.getcwd() _files = os.listdir() # Look for a jsonld file for _...
Get the filenames that the LiPD utilities has generated (per naming standard), as opposed to the filenames that originated in the LiPD file (that possibly don't follow the naming standard) :param dict d: Data :param str name: LiPD dataset name to prefix :param list csvs: Filenames list to merge with ...
List all the files contained in the LiPD archive. Bagit, JSON, and CSV :param str path: Directory to be listed :param str name: LiPD dataset name, if you want to prefix it to show file hierarchy :return list: Filenames found def get_filenames_in_lipd(path, name=""): """ List all the files contained...
User sets the path to a LiPD source location :param str mode: "read" or "write" mode :param str path_type: "directory" or "file" :return str path: dir path to files :return list files: files chosen def get_src_or_dst(mode, path_type): """ User sets the path to a LiPD source location :param ...
String together the proper prompt based on the mode :param str mode: "read" or "write" :return str prompt: The prompt needed def get_src_or_dst_prompt(mode): """ String together the proper prompt based on the mode :param str mode: "read" or "write" :return str prompt: The prompt needed """ ...
Let the user choose a path, and store the value. :return str _path: Target directory :return str count: Counter for attempted prompts def get_src_or_dst_path(prompt, count): """ Let the user choose a path, and store the value. :return str _path: Target directory :return str count: Counter for a...
Lists file(s) in given path of the X type. :param str x: File extension that we are interested in. :param str path: Path, if user would like to check a specific directory outside of the CWD :return list of str: File name(s) to be worked on def list_files(x, path=""): """ Lists file(s) in given path...
Removes all files within a directory, but does not delete the directory :param str path: Target directory :return none: def rm_files_in_dir(path): """ Removes all files within a directory, but does not delete the directory :param str path: Target directory :return none: """ for f in os....
Remove a file if it exists. Useful for when we want to write a file, but it already exists in that locaiton. :param str filename: Filename :param str path: Directory :return none: def rm_file_if_exists(path, filename): """ Remove a file if it exists. Useful for when we want to write a file, but it ...
Generate the languages Python module. def regenerate(location='http://www.iana.org/assignments/language-subtag-registry', filename=None, default_encoding='utf-8'): """ Generate the languages Python module. """ paren = re.compile('\([^)]*\)') # Get the language list. data = urlli...
r"""Patch a class to give it a generic __repr__ method that works by inspecting the instance dictionary. Parameters ---------- cls: type The class to add a generic __repr__ to. Returns ------- cls: type The passed class is returned def give_repr(cls): # pragma: no cover ...
r''' Given two lists of values, the first list being the `power sum`s of a polynomial, and the second being expressions of the roots of the polynomial as found by Viete's Formula, use information from the longer list to fill out the shorter list using Newton's Identities. .. note:: Updates ...
r''' Given the coefficients of a polynomial of a single variable, compute an elementary symmetric polynomial of the roots of the input polynomial by Viete's Formula: .. math:: \sum_{1\le i_1<i_2<...<i_k \le n} x_{i_1}x_{i_2}...x_{i_k} = (-1)^k\frac{a_{n-k}}{a_n} Parameters ---------- ...
Calculates the maximum number of isotopic variants that could be produced by a composition. Parameters ---------- composition : Mapping Any Mapping type where keys are element symbols and values are integers Returns ------- max_n_variants : int def max_variants(composition): ...
Compute a peak list representing the theoretical isotopic cluster for `composition`. Parameters ---------- composition : Mapping Any Mapping type where keys are element symbols and values are integers npeaks: int The number of peaks to include in the isotopic cluster, starting from the ...
Execute command line helper. def call(): """Execute command line helper.""" args = get_arguments() # Set up logging if args.debug: log_level = logging.DEBUG elif args.quiet: log_level = logging.WARN else: log_level = logging.INFO setup_logging(log_level) skybe...
Trim and upsample PET image(s), e.g., for GPU execution, PVC correction, ROI sampling, etc. The input images 'fims' can be passed in multiple ways: 1. as a string of the folder containing NIfTI files 2. as a string of a NIfTI file path (this way a 4D image can be loaded). 3. as a list of NIfTI file ...
Separable kernels for convolution executed on the GPU device The outputted kernels are in this order: z, y, x def psf_general(vx_size=(1,1,1), fwhm=(5, 5, 6), hradius=8, scale=2): ''' Separable kernels for convolution executed on the GPU device The outputted kernels are in this order: z, y, x ''' ...
partial volume correction using iterative Yang method imgIn: input image which is blurred due to the PSF of the scanner krnl: shift invariant kernel of the PSF imgSeg: segmentation into regions starting with 0 (e.g., background) and then next integer numbers itr: number of iteration (default 5) def iya...
Perform partial volume (PVC) correction of PET data (petin) using MRI data (mridct). The PVC method uses iterative Yang method. GPU based convolution is the key routine of the PVC. Input: ------- petin: either a dictionary containing image data, file name and affine transform, ...
HU units to 511keV PET mu-values https://link.springer.com/content/pdf/10.1007%2Fs00259-002-0796-3.pdf C. Burger, et al., PET attenuation coefficients from CT images, def ct2mu(im): '''HU units to 511keV PET mu-values https://link.springer.com/content/pdf/10.1007%2Fs00259-002-0796-3.pdf ...
Calculate the centre of mass of an image along each axes (x,y,z), separately. Arguments: imdct - the image dictionary with the image and header data. Output the list of the centre of mass for each axis. def centre_mass_img(imdct): ''' Calculate the centre of mass of an image along e...
Modify the NIfTI image given either as a file path or a dictionary, obtained by nimpa.getnii(file_path). def nii_modify( nii, fimout = '', outpath = '', fcomment = '', voxel_range=[]): ''' Modify the NIfTI image given either as a file path or a dictionary, o...
Correct for bias field in MR image(s) given in <fmr> as a string (single file) or as a list of strings (multiple files). Output dictionary with the bias corrected file names. Options: - fimout: The name (with path) of the output file. It's ignored when...
Extracting ROI values of upsampled PET. If not provided it will be upsampled. imdic: dictionary of all image parts (image, path to file and affine transformation) > fpet: file name for quantitative PET > faff: file name and path to the affine (rigid) transformations, most likely for upscaled PET ...
Get PET image from NIfTI file. fim: input file name for the nifty image nan_replace: the value to be used for replacing the NaNs in the image. by default no change (None). output: option for choosing output: image, affine matrix or a dictionary with all info. ---------- Return...
Extracts the custom description header field to dictionary def getnii_descr(fim): ''' Extracts the custom description header field to dictionary ''' nim = nib.load(fim) hdr = nim.header rcnlst = hdr['descrip'].item().split(';') rcndic = {} if rcnlst[0]=='': # print 'w> no d...
Store the numpy array 'im' to a NIfTI file 'fnii'. ---- Arguments: 'im': image to be stored in NIfTI 'A': affine transformation 'fnii': output NIfTI file name. 'descrip': the description given to the file 'trsnp': transpose/permute the dimensions. ...
Get the orientation from NIfTI sform. Not fully functional yet. def orientnii(imfile): '''Get the orientation from NIfTI sform. Not fully functional yet.''' strorient = ['L-R', 'S-I', 'A-P'] niiorient = [] niixyz = np.zeros(3,dtype=np.int8) if os.path.isfile(imfile): nim = nib.load(imfile...
Uncompress *.gz file def nii_ugzip(imfile, outpath=''): '''Uncompress *.gz file''' import gzip with gzip.open(imfile, 'rb') as f: s = f.read() # Now store the uncompressed data if outpath=='': fout = imfile[:-3] else: fout = os.path.join(outpath, os.path.basename(imfile)...
Compress *.gz file def nii_gzip(imfile, outpath=''): '''Compress *.gz file''' import gzip with open(imfile, 'rb') as f: d = f.read() # Now store the compressed data if outpath=='': fout = imfile+'.gz' else: fout = os.path.join(outpath, os.path.basename(imfile)+'.gz') ...
Pick the MR T1w from the dictionary for MR->PET registration. def pick_t1w(mri): ''' Pick the MR T1w from the dictionary for MR->PET registration. ''' if isinstance(mri, dict): # check if NIfTI file is given if 'T1N4' in mri and os.path.isfile(mri['T1N4']): ft1w = mri['T1N4'] ...
Get basic info about the DICOM file/header. def dcminfo(dcmvar, verbose=True): ''' Get basic info about the DICOM file/header. ''' if isinstance(dcmvar, basestring): if verbose: print 'i> provided DICOM file:', dcmvar dhdr = dcm.dcmread(dcmvar) elif isinstance(dcmvar, dict)...
List all DICOM file paths in the datain dictionary of input data. def list_dcm_datain(datain): ''' List all DICOM file paths in the datain dictionary of input data. ''' if not isinstance(datain, dict): raise ValueError('The input is not a dictionary!') dcmlst = [] # list of mu-map DICOM f...
Anonymise DICOM file(s) Arguments: > dcmpth: it can be passed as a single DICOM file, or a folder containing DICOM files, or a list of DICOM file paths. > patient: the name of the patient. > physician:the name of the referring physician. > dob: patient...
Sort out the DICOM files in the folder according to the recorded series. def dcmsort(folder, copy_series=False, verbose=False): ''' Sort out the DICOM files in the folder according to the recorded series. ''' # list files in the input folder files = os.listdir(folder) srs = {} for f in files:...
Sort all input NIfTI images and check their shape. Output dictionary of image files and their properties. Options: memlim -- when processing large numbers of frames the memory may not be large enough. memlim causes that the output does not contain all the arrays corr...
Convert DICOM files in folder (indicated by <dcmpth>) using DCM2NIIX third-party software. def dcm2nii( dcmpth, fimout = '', fprefix = 'converted-from-DICOM_', fcomment = '', outpath = '', timestamp = True, executable = '', force = False, ): ...
Get the DICOM files from 'fpth' into an image with the affine transformation. fpth can be a list of DICOM files or a path (string) to the folder with DICOM files. def dcm2im(fpth): ''' Get the DICOM files from 'fpth' into an image with the affine transformation. fpth can be a list of DICOM files or...
Get the path to the local (home) folder for NiftyPET resources. def path_niftypet_local(): '''Get the path to the local (home) folder for NiftyPET resources.''' # if using conda put the resources in the folder with the environment name if 'CONDA_DEFAULT_ENV' in os.environ: env = os.environ['CONDA_D...
Locate the CUDA environment on the system. def find_cuda(): '''Locate the CUDA environment on the system.''' # search the PATH for NVCC for fldr in os.environ['PATH'].split(os.pathsep): cuda_path = join(fldr, 'nvcc') if os.path.exists(cuda_path): cuda_path = os.path.dirname(os.p...
figure out what GPU devices are available and choose the supported ones. def dev_setup(): '''figure out what GPU devices are available and choose the supported ones.''' # check first if NiftyPET was already installed and use the choice of GPU path_resources = path_niftypet_local() # if so, import the ...
This function checks CUDA devices, selects some and installs resources.py def resources_setup(): ''' This function checks CUDA devices, selects some and installs resources.py ''' print 'i> installing file <resources.py> into home directory if it does not exist.' path_current = os.path.dirname( os.p...
Implementation of a coroutine. Use as a decorator: @coroutine def foo(): result = yield somePromise The function passed should be a generator yielding instances of the Promise class (or compatible). The coroutine waits for the Promise to resolve and sends the result (or the error) ...
This is not a coroutine ;) Use as a decorator: @no_coroutine def foo(): five = yield 5 print(yield "hello") The function passed should be a generator yielding whatever you feel like. The yielded values instantly get passed back into the generator. It's basically the same as if ...
Either be a coroutine or not. Use as a decorator: @maybe_coroutine(lambda maybeAPromise: return isinstance(maybeAPromise, Promise)) def foo(maybeAPromise): result = yield maybeAPromise print("hello") return result The function passed should be a generator yielding either only P...
Take a function that reports its result using a callback and return a Promise that listenes for this callback. The function must accept a callback as its first parameter. The callback must take two arguments: - success : True or False - result : The result of the operation if success is True or th...
Calculates the monoisotopic mass of a composition Parameters ---------- composition : Mapping Any Mapping type where keys are element symbols and values are integers mass_data : dict, optional A dict with the masses of the chemical elements (the default value is :py:data:`nist_m...
Parse a chemical formula and construct a :class:`PyComposition` object Parameters ---------- formula : :class:`str` Returns ------- :class:`PyComposition` Raises ------ ValueError If the formula doesn't match the expected pattern def parse_formula(formula): """Parse a...
Execute Skybell login. def login(self, username=None, password=None): """Execute Skybell login.""" if username is not None: self._username = username if password is not None: self._password = password if self._username is None or not isinstance(self._username, s...
Explicit Skybell logout. def logout(self): """Explicit Skybell logout.""" if self.cache(CONST.ACCESS_TOKEN): # No explicit logout call as it doesn't seem to matter # if a logout happens without registering the app which # we aren't currently doing. self._...
Get all devices from Abode. def get_devices(self, refresh=False): """Get all devices from Abode.""" if refresh or self._devices is None: if self._devices is None: self._devices = {} _LOGGER.info("Updating all devices...") response = self.send_request...
Send requests to Skybell. def send_request(self, method, url, headers=None, json_data=None, retry=True): """Send requests to Skybell.""" if not self.cache(CONST.ACCESS_TOKEN) and url != CONST.LOGIN_URL: self.login() if not headers: headers = {} ...
Update a cached value. def update_cache(self, data): """Update a cached value.""" UTILS.update(self._cache, data) self._save_cache()
Get a cached value for a device. def dev_cache(self, device, key=None): """Get a cached value for a device.""" device_cache = self._cache.get(CONST.DEVICES, {}).get(device.device_id) if device_cache and key: return device_cache.get(key) return device_cache
Update cached values for a device. def update_dev_cache(self, device, data): """Update cached values for a device.""" self.update_cache( { CONST.DEVICES: { device.device_id: data } })
Load existing cache and merge for updating if required. def _load_cache(self): """Load existing cache and merge for updating if required.""" if not self._disable_cache: if os.path.exists(self._cache_path): _LOGGER.debug("Cache found at: %s", self._cache_path) ...
bare_jids: iterable<string> encryption_callback: A function which is called using an instance of cryptography.hazmat.primitives.ciphers.CipherContext, which you can use to encrypt any sort of data. You don't have to return anything. bundles: { [bare_jid: string] => { [device_id: int] => ExtendedPublicBu...
Delete inactive devices by setting a quota. With per_jid_max you can define the amount of inactive devices that are kept for each jid, with global_max you can define a global maximum for inactive devices. If any of the quotas is reached, inactive devices are deleted on an LRU basis. This also de...
Delete all inactive devices from the device list storage and cache that are older then a given number of days. This also deletes the corresponding sessions, so if a device comes active again and tries to send you an encrypted message you will not be able to decrypt it. You are not allowed to del...
Runs both the deleteInactiveDevicesByAge and the deleteInactiveDevicesByQuota methods with the configuration that was set when calling create. def runInactiveDeviceCleanup(self): """ Runs both the deleteInactiveDevicesByAge and the deleteInactiveDevicesByQuota methods with the configura...
All-in-one trust information for all devices of a bare jid. The result is structured like this: { "active" : { device: int => trust_info } "inactive" : { device: int => trust_info } } where trust_info is the structure returned by getTrustForDevice. def getTru...
Delete all data associated with a JID. This includes the list of active/inactive devices, all sessions with that JID and all information about trusted keys. def deleteJID(self, bare_jid): """ Delete all data associated with a JID. This includes the list of active/inactive devices, all s...
Return a dictionary of GPU, mu-map hardware and third party set-up. def get_setup(Cnt = {}): '''Return a dictionary of GPU, mu-map hardware and third party set-up.''' # the name of the folder for NiftyPET tools Cnt['DIRTOOLS'] = DIRTOOLS # additional paramteres for compiling tools with cmake ...
Put all the constants together in a dictionary def get_mmr_constants(): ''' Put all the constants together in a dictionary ''' Cnt = { 'ISOTOPE':'F18', 'DCYCRR':DCYCRR, 'ALPHA':ALPHA, 'NRNG':NRNG, 'NSRNG':NSRNG, 'NCRS':NCRS, 'NCRSR':NCRSR, ...
Check version and existence of all third-party software and input data. Output a dictionary with bool type of the requested bits in 'chcklst' def check_version(Cnt, chcklst=['RESPATH','REGPATH','DCM2NIIX','HMUDIR']): ''' Check version and existence of all third-party software and input data. Output...
Install the requested software from the git 'repo' and check out the version given by 'sha1'. def install_tool(app, Cnt): ''' Install the requested software from the git 'repo' and check out the version given by 'sha1'. ''' # get the current working directory cwd = os.getcwd() # p...
Update resources.py with the paths to the new installed apps. def update_resources(Cnt): '''Update resources.py with the paths to the new installed apps. ''' # list of path names which will be saved key_list = ['PATHTOOLS', 'RESPATH', 'REGPATH', 'DCM2NIIX', 'HMUDIR'] # get the local path to Nifty...
Return a dict containing the session for each device id. By default, this method calls loadSession for each device id. def loadSessions(self, callback, bare_jid, device_ids): """ Return a dict containing the session for each device id. By default, this method calls loadSession for each ...
Return a dict containing the trust status for each device id. By default, this method calls loadTrust for each device id. def loadTrusts(self, callback, bare_jid, device_ids): """ Return a dict containing the trust status for each device id. By default, this method calls loadTrust for e...
Use this method when creating a bundle from data you retrieved directly from some PEP node. This method applies an additional decoding step to the public keys in the bundle. Pass the same structure as the constructor expects. def parse(cls, backend, ik, spk, spk_signature, otpks): """ U...
Use this method to prepare the data to be uploaded directly to some PEP node. This method applies an additional encoding step to the public keys in the bundle. The result is a dictionary with the keys ik, spk, spk_signature and otpks. The values are structured the same way as the inputs of the c...
fill the empty patches of image mask 'immsk' def imfill(immsk): '''fill the empty patches of image mask 'immsk' ''' for iz in range(immsk.shape[0]): for iy in range(immsk.shape[1]): ix0 = np.argmax(immsk[iz,iy,:]>0) ix1 = immsk.shape[2] - np.argmax(immsk[iz,iy,::-1]>0) ...
create mask over the whole image or over the threshold area def create_mask( fnii, fimout = '', outpath = '', fill = 1, dtype_fill = np.uint8, thrsh = 0., fwhm = 0.,): ''' create mask over the whole image or over the threshold area''' #> o...
Resample the floating image <fflo> into the geometry of <fref>, using the Vinci transformation output <faff> (an *.xml file). Output the NIfTI file path of the resampled/resliced image. def resample_vinci( fref, fflo, faff, intrp = 0, fimout = '', fcommen...
Calculate Dice score for parcellation images <im1> and <im2> and ROI value <val>. Input images can be given as: 1. paths to NIfTI image files or as 2. Numpy arrays. The ROI value can be given as: 1. a single integer representing one ROI out of many in the parcellation...