"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = ["warpolygon0.nii", 
        "warpolygon1.nii", 
        "warpolygon2.nii", 
        "warpolygon3.nii",
        "warpolygon4.nii", 
        "warpolygon5.nii"]

# Create the niftis, remove and arn if they do not exist
for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis),
        os.path.join(datadir, "warpolygon.nii"))
"""Combine ar* functional data in along their 4th axes.

usage: combined_func_biasbox datadir
"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = [
    "warbiasbox0.nii", "warbiasbox1.nii", "warbiasbox2.nii", "warbiasbox3.nii",
    "warbiasbox4.nii"
]

for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warbiasbox.nii"))
# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = [
    "warbutterfly0.nii", "warbutterfly1.nii", "warbutterfly2.nii",
    "warbutterfly3.nii", "warbutterfly4.nii", "warbutterfly5.nii",
    "warbutterfly6.nii", "warbutterfly7.nii", "warbutterfly8.nii",
    "warbutterfly9.nii"
]

for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

# Create the niftis, remove and arn if they do not exist
niftis = []
for fname in fnames:
    try:
        niftis.append(read_nifti(os.path.join(datadir, fname)))
    except IOError:
        print("Warning: {0} not found".format(fname))
        pass
#niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warbutterfly.nii"))
"""Combine ar* functional data in along their 4th axes.

usage: combined_func_fh datadir
"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError("Only one argument allowed")
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = ["warfh0.nii", "warfh1.nii", "warfh2.nii", "warfh3.nii", "warfh4.nii", "warfh5.nii", "warfh6.nii"]

for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warfh.nii"))
示例#5
0
"""Combine ar* functional data in along their 4th axes.

usage: combined_func_redgreen datadir
"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = [
    "warredgreen0.nii", "warredgreen1.nii", "warredgreen2.nii",
    "warredgreen3.nii", "warredgreen4.nii", "warredgreen5.nii"
]

# Create the niftis, remove and arn if they do not exist
for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warredgreen.nii"))
示例#6
0
"""Combine ar* functional data in along their 4th axes.

usage: combined_func_polygon datadir
"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = [
    "warpolygon0.nii", "warpolygon1.nii", "warpolygon2.nii", "warpolygon3.nii",
    "warpolygon4.nii", "warpolygon5.nii"
]

# Create the niftis, remove and arn if they do not exist
for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warpolygon.nii"))
"""Combine ar* functional data in along their 4th axes.

usage: combined_func_clock datadir
"""
import sys
import os
from roi.pre import combine4d
from roi.io import read_nifti, write_nifti

# Process the argv
if len(sys.argv[1:]) != 1:
    raise ValueError('Only one argument allowed')
datadir = sys.argv[1]

# Name the names, then read in the data
fnames = ["warclock0.nii", "warclock1.nii", "warclock2.nii", "warclock3.nii"]

for i, fname in enumerate(fnames):
    if not os.path.exists(os.path.join(datadir, fname)):
        print("Missing {0}".format(fname))
        fnames.pop(i)

niftis = [read_nifti(os.path.join(datadir, fname)) for fname in fnames]

# Combine the nifti objects and write the result
write_nifti(combine4d(niftis), os.path.join(datadir, "warclock.nii"))