-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4cec6f
commit 3b53178
Showing
15 changed files
with
118 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function result = does_is_similar_to_tif_check_file_exist(tif_file_path, tif_root_path, mj2_root_path) | ||
tif_relative_path = relpath(tif_file_path, tif_root_path) ; | ||
mj2_relative_path = replace_extension(tif_relative_path, '.mj2') ; | ||
mj2_file_path = fullfile(mj2_root_path, mj2_relative_path) ; | ||
check_file_path = horzcat(mj2_file_path, '.is-similar-to-tif') ; | ||
result = logical(exist(check_file_path, 'file')) ; | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function result = does_need_preverification_after_freezing(tif_file_path, tif_root_path, mj2_root_path) | ||
[~,file_name] = fileparts2(tif_file_path) ; | ||
result = does_file_name_end_in_dot_tif(file_name) && ... | ||
~does_is_similar_to_tif_check_file_exist(tif_file_path, tif_root_path, mj2_root_path) ; | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sample_date = '2018-10-01' ; | ||
mj2_output_folder_path = sprintf('/nrs/mouselight-v/frozen/%s', sample_date) ; | ||
tif_input_folder_path = sprintf('/groups/mousebrainmicro/mousebrainmicro/data/%s', sample_date) ; | ||
compression_ratio = 10 ; | ||
do_verify = false ; | ||
do_run_on_cluster = true ; | ||
|
||
mj2_from_tif(mj2_output_folder_path, tif_input_folder_path, compression_ratio, do_verify, do_run_on_cluster) | ||
is_all_well = verify_frozen_files(mj2_output_folder_path, tif_input_folder_path, do_run_on_cluster) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sample_date = '2018-12-01' ; | ||
mj2_output_folder_path = sprintf('/nrs/mouselight-v/frozen/%s/Tiling', sample_date) ; | ||
tif_input_folder_path = sprintf('/nrs/mouselight/pipeline_output/%s/stage_1_line_fix_output', sample_date) ; | ||
compression_ratio = 10 ; | ||
do_verify = false ; | ||
do_run_on_cluster = true ; | ||
|
||
mj2_from_tif(mj2_output_folder_path, tif_input_folder_path, compression_ratio, do_verify, do_run_on_cluster) | ||
is_all_well = verify_frozen_files(mj2_output_folder_path, tif_input_folder_path, do_run_on_cluster) |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
mj2_from_tif(mj2_output_folder_path, tif_input_folder_path, compression_ratio, do_verify, do_run_on_cluster) | ||
%is_all_well = verify_frozen_files(mj2_output_folder_path, tif_input_folder_path, do_run_on_cluster) | ||
|
||
fprintf('Doing batch preverification of .tif files...\n') ; | ||
batch_preverify_tif_files_after_mj2_from_tif(mj2_output_folder_path, tif_input_folder_path, do_run_on_cluster) | ||
fprintf('Done with batch preverification of .tif files.\n') ; | ||
|
||
fprintf('Doing verification of .tif files...\n') ; | ||
verify_tif_files_after_mj2_from_tif(tif_input_folder_path, mj2_output_folder_path) ; | ||
fprintf('Done with verification of .tif files.\n') ; | ||
|
||
fprintf('Doing verification of non-.tif files...\n') ; | ||
verify_non_tif_files_after_mj2_from_tif(mj2_output_folder_path, tif_input_folder_path) ; | ||
fprintf('Done with verification of non-.tif files.\n') ; | ||
|
||
% Delete certificate files (just run locally) | ||
find_and_batch(mj2_output_folder_path, ... | ||
@does_file_name_match_certificate_file, ... | ||
@delete, ... | ||
false, ... | ||
'') ; | ||
|
||
% Do a final comparison of .tif files and .mj2 files, just for the heck of it | ||
[status, result] = system(sprintf('find %s -name "*.tif" -print | wc -l', tif_input_folder_path)) ; | ||
if status~= 0 , | ||
error('Unable to count number of .tif files\n') ; | ||
end | ||
final_tif_count = str2double(result) ; | ||
fprintf('.tif count in %s is: %d\n', tif_input_folder_path, final_tif_count) ; | ||
|
||
[status, result] = system(sprintf('find %s -name "*.mj2" -print | wc -l', mj2_output_folder_path)) ; | ||
if status~= 0 , | ||
error('Unable to count final number of .mj2 files\n') ; | ||
end | ||
final_mj2_count = str2double(result) ; | ||
fprintf('Final .mj2 count in %s is: %d\n', mj2_output_folder_path, final_mj2_count) ; | ||
|
||
% Report final status if we get this far | ||
fprintf('Compression and verification succeeded!\n') ; | ||
|
||
|
||
|
This file contains 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
Submodule mouselight_toolbox
updated
14 files
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
path_to_this_script = mfilename('fullpath') ; | ||
path_to_this_folder = fileparts(path_to_this_script) ; | ||
mj2_output_folder_path = fullfile(path_to_this_folder, 'freezing-test-output-folder') ; | ||
tif_input_folder_path = fullfile(path_to_this_folder, 'freezing-test-input-folder') ; | ||
compression_ratio = 10 ; | ||
do_verify = false ; | ||
do_run_on_cluster = false ; | ||
|
||
% Delete the test output folder | ||
reset_for_test(mj2_output_folder_path) ; | ||
|
||
% Call the script | ||
freeze_sample |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
path_to_this_script = mfilename('fullpath') ; | ||
path_to_this_folder = fileparts(path_to_this_script) ; | ||
mj2_output_folder_path = fullfile(path_to_this_folder, 'freezing-test-output-folder') ; | ||
tif_input_folder_path = fullfile(path_to_this_folder, 'freezing-test-input-folder') ; | ||
compression_ratio = 10 ; | ||
do_verify = false ; | ||
do_run_on_cluster = true ; | ||
|
||
% Delete the test output folder | ||
reset_for_test(mj2_output_folder_path) ; | ||
|
||
% Call the script | ||
freeze_sample |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
function is_all_well = verify_non_tif_files_after_mj2_from_tif(mj2_root_folder_path, tif_root_folder_path) | ||
function verify_non_tif_files_after_mj2_from_tif(mj2_root_folder_path, tif_root_folder_path) | ||
% Makes sure all the target files are present in the the destination, and have | ||
% the right size, or at least a plausible size in the case of .mj2's. | ||
|
||
is_all_well = ... | ||
find_and_verify(tif_root_folder_path, ... | ||
@does_file_name_not_end_in_dot_tif, ... | ||
@verify_single_non_tif_file_after_mj2_from_tif, ... | ||
tif_root_folder_path, ... | ||
mj2_root_folder_path) ; | ||
find_and_verify(tif_root_folder_path, ... | ||
@does_file_name_not_end_in_dot_tif, ... | ||
@verify_single_non_tif_file_after_mj2_from_tif, ... | ||
tif_root_folder_path, ... | ||
mj2_root_folder_path) ; | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
function is_all_well = verify_tif_files_after_mj2_from_tif(tif_root_folder_path, mj2_root_folder_path) | ||
function verify_tif_files_after_mj2_from_tif(tif_root_folder_path, mj2_root_folder_path) | ||
% Makes sure there's a .similar-mj2-exists for each .tif file in | ||
% tif_root_folder_path. | ||
is_all_well = find_and_verify(tif_root_folder_path, ... | ||
@does_file_name_end_in_dot_tif, ... | ||
@verify_single_tif_file_after_mj2_from_tif, ... | ||
tif_root_folder_path, ... | ||
mj2_root_folder_path) ; | ||
find_and_verify(tif_root_folder_path, ... | ||
@does_file_name_end_in_dot_tif, ... | ||
@verify_single_tif_file_after_mj2_from_tif, ... | ||
tif_root_folder_path, ... | ||
mj2_root_folder_path) ; | ||
end | ||
|