Skip to content

Commit

Permalink
change numberOfJobs as str for SlicerWMA
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangfanmark committed Jul 5, 2023
1 parent e2e2151 commit db05069
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin/wm_cluster_from_atlas.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import multiprocessing
import time

import vtk

try:
Expand Down Expand Up @@ -40,7 +39,7 @@ def main():
'-l', action="store", dest="fiberLength", type=int, default=40,
help='Minimum length (in mm) of fibers to analyze. 60mm is default.')
parser.add_argument(
'-j', action="store", dest="numberOfJobs", type=int, default=1,
'-j', action="store", dest="numberOfJobs", type=str, default='1',
help='Number of processors to use.')
parser.add_argument(
'-verbose', action='store_true', dest="flag_verbose",
Expand Down Expand Up @@ -92,7 +91,7 @@ def main():
fiber_length = args.fiberLength
print("minimum length of fibers to analyze (in mm): ", fiber_length)

number_of_jobs = args.numberOfJobs
number_of_jobs = int(args.numberOfJobs)
print('Using N jobs:', number_of_jobs)

if args.flag_verbose:
Expand Down Expand Up @@ -303,6 +302,7 @@ def main():

print("\n==========================")
print('<wm_cluster_from_atlas.py> Done clustering subject. See output in directory:\n ', outdir, '\n')



if __name__ == '__main__':
main()
4 changes: 2 additions & 2 deletions bin/wm_cluster_remove_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def main():
'-advanced_only_outlier_sigma', action='store', dest="outlierSigma", type=float, default=20.0,
help='(Advanced parameter that probably should not be changed.) Local sigma used to compute fiber probability in cluster-based outlier removal. The default is 20mm. For stricter clustering, this may be reduced to 15mm.')
parser.add_argument(
'-j', action="store", dest="numberOfJobs", type=int,
'-j', action="store", dest="numberOfJobs", type=str,
help='Number of processors to use.')

args = parser.parse_args()
Expand Down Expand Up @@ -82,7 +82,7 @@ def main():
os.makedirs(outdir)

if args.numberOfJobs is not None:
number_of_jobs = args.numberOfJobs
number_of_jobs = int(args.numberOfJobs)
else:
# default to 1 job for usage on compute clusters. Also, the
# multiprocessing is not used efficiently in our code and should
Expand Down

0 comments on commit db05069

Please sign in to comment.