Child pages
  • Disk cleanup after a registration

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added -v flag to rm, to see progress of cleanup

...

Code Block
# Using the output from the command above you can run the following which only prints all the tmp directories:
> find /path/to/pipeline_processed -name tmp -type d

# and actually remove them
> find /path/to/pipeline_processed -name tmp -type d -exec rm -rfrfv \{} \;

Another way to find all possible pipeline tmp files and delete them:

Code Block
# remove all possible tmp directories:
> find /main/path/ -path '*_processed/*/tmp' -type d -exec rm -rfrfv \{} \;
# on HPF, that could be one of the following:
> find /hpf/largeprojects/MICe/yourusername/ -path '*_processed/*/tmp' -type d -exec rm -rfrfv \{} \;

Deep Cleaning

Code Block
languagebash
#
# *_processed/*/resampled

# if you only want to keep the lsq6 and final nlin file:
for file in *_processed/*/resampled/*{__concat_lsq6_N_I_lsq6_lsq12_and_nlin-resampled.mnc,_N_I_lsq6_avg_lsq12-resampled.mnc}; do if [ -f $file ]; then rm -ffv $file; fi; done 


Code Block
languagebash
#
# *_processed/*/transforms

# From all the transformations that are produced you only need to keep the:
# pure non linear ("*N_I_lsq6_lsq12_and_nlin__concat_inverted_linear_part.xfm") - used to calculate relative Jacobians
# full linear and non linear ("*_N_I_lsq6_lsq12_and_nlin") - used to calculate absolute Jacobians
# the following can all safely be removed:
for file in *_processed/*/transforms/*{_mt_to_,_N_I_lsq6_lsq12_and_nlin_inverted,__concat_lsq6_N_I_lsq6_lsq12_and_nlin}*; do if [ -f $file ]; then rm -ffv $file; fi; done

# And if you want to remove the transforms used to create relative jacobians
for file in *_processed/*/transforms/*N_I_lsq6_lsq12_and_nlin__concat_inverted_linear_part*; do if [ -f $file ]; then rm -ffv $file; fi; done


Code Block
#
# *_processed/*/masking/transforms

# This removes all the transforms used to register to the atlas for initial masking purposes
for file in *_processed/*/masking/transforms/*{mt_to_Dorr_2008_Steadman_2013_Ullmann_2013_on_NRXN1a_v1_average_lsq12,mt_to_Dorr_2008_Steadman_2013_Ullmann_2013_on_NRXN1a_v1_average_nlin_5}*; do if [ -f $file ]; then rm -ffv $file; fi; done

Other cleaning:

...