Commit 0e4e0a56 authored by Vladimír Ulman's avatar Vladimír Ulman
Browse files

CHG,ADD: extra param reporting the size of the fixed set of inputs,

         iterating over combinations is assuring the fixed set is always
         present in all created combinations
parent 4e1faefa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ for gtFolder in ../gtReference/*; do
			fixedFiles=`ls -d ../userResults/$gtFolderBasename/fixed/*/${video}_RES | { while read i; do printf "\"%s\" " "$i"; done }`
			  varFiles=`ls -d ../userResults/$gtFolderBasename/*/${video}_RES       | { while read i; do printf "\"%s\" " "$i"; done }`

			echo python3 $1 $2 ../fusionOutputs "${gtFolderBasename}-$video" "$timePointsBoth" $gtFolder/${video}_GT "$fixedFiles" "$varFiles" > "${gtFolderBasename}-${video}.cmd"
			echo python3 $1 $2 ../fusionOutputs "${gtFolderBasename}-$video" "$timePointsBoth" $gtFolder/${video}_GT `ls -d ../userResults/$gtFolderBasename/fixed/*/${video}_RES | wc -l` "$fixedFiles" "$varFiles" > "${gtFolderBasename}-${video}.cmd"
		fi
	done
done
+14 −7
Original line number Diff line number Diff line
@@ -71,19 +71,23 @@ def AddNextResult(SEG,combination):

#----------------------------------------------------
# the main script starts here:
if(len(sys.argv.__str__().split()) < 7):	# First parameter calls this function
	sys.exit("There should be at least 6 parameters:\n"
if(len(sys.argv.__str__().split()) < 8):	# First parameter calls this function
	sys.exit("There should be at least 7 parameters:\n"
	        +"1. Path Fiji binary\n"
	        +"2. Output Folder\n"
	        +"3. Video Name\n"
	        +"4. Time Points list\n"
	        +"5. TRA Folder\n"
	        +"6. Input Folder 1\n"
	        +"7. Input Folder 2\n"
	        +"8. ...")
	        +"6. N, Number of fixed inputs >= 0\n"
	        +"7. Input Fixed Folder 1\n"
	        +"..."
	        +"7+N Input Fixed Folder N\n"
	        +"7+N+1 Input Folder N+1\n"
	        +"7+N+2 Input Folder N+2\n"
	        +"...")

inputFolders=[]
for i in range(6,len(sys.argv)):
for i in range(7,len(sys.argv)):
   inputFolders.append(sys.argv[i])

#print(["INPUTS here: ",inputFolders])
@@ -96,6 +100,9 @@ videoname = sys.argv[3]
timesStr = sys.argv[4]
gtFolder = sys.argv[5]		# folder with tracking markers

fixedInputsN = int(sys.argv[6])
inputsIncrement = 2**fixedInputsN

N = len(inputFolders)
#N=0 -- 000000000001 == 1 << 0
#N=1 -- 000000000010 == 1 << 1
@@ -105,7 +112,7 @@ N = len(inputFolders)

# the combinations sampling happens here
# the current combination is stored in the array of paths: inFolders
for j in range(1, 2**N):		# examine combination, bit by bit from the right
for j in range(inputsIncrement-1, 2**N, inputsIncrement):		# examine combination, bit by bit from the right
	inFolders = []
	for i in range(0,N):
		if (j & (1 << i)) > 0:	# if i-th bit is 1, then add inputFolders[i]