Created
October 11, 2015 20:54
-
-
Save chrisgorgo/46edde21353d8debf2f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_folder = "/Volumes/Samsung_T1/bids_examples/symlinked" | |
target_folder = "/Volumes/Samsung_T1/bids_examples/empty" | |
import shutil, os | |
from glob import glob | |
try: | |
shutil.rmtree(target_folder) | |
except: | |
pass | |
import subprocess | |
subprocess.call("cp -R %s %s"%(source_folder, target_folder), shell=True) | |
for nii in glob(target_folder+"/*/*/*/*.nii.gz") + glob(target_folder+"/*/*/*/*/*.nii.gz"): | |
os.remove(nii) | |
open(nii, "w").close() | |
subprocess.call("dot_clean %s"%target_folder, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment