Skip to content

Commit

Permalink
added illumination correction with basicpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Perez Meza committed Nov 4, 2024
1 parent b02f3e7 commit 87850ec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions macsima2mc/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def get_args():
help='string specifying the name of the reference marker'
)

parser.add_argument('-od',
'--output_dir',
default='raw',
help='string specifying the name of the reference marker'
)

parser.add_argument('-ic',
'--illumination_correction',
action='store_true',
Expand Down
11 changes: 9 additions & 2 deletions macsima2mc/macsima2mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ def main(args):
input=args.input
output=args.output
ref=args.reference_marker
basicpy_corr=args.illumination_correction
basicpy_corr=args.illumination_correction
out_folder_name=args.output_dir

cycle_info=tools.cycle_info( input , macsima_pattern(version=2),ref_marker= ref)
cycle_info=tools.append_metadata( cycle_info )
#cycle_info.to_csv( args.output / 'cycle_{c}_info.csv'.format(c=f'{6:03d}'), index=False )
output_dirs=tools.create_stack( cycle_info, output ,ref_marker=ref,hi_exp=args.hi_exposure_only,ill_corr=basicpy_corr)
output_dirs=tools.create_stack( cycle_info, output ,
ref_marker=ref,
hi_exp=args.hi_exposure_only,
ill_corr=basicpy_corr,
out_folder=out_folder_name
)
[mc_tools.write_markers_file(path) for path in output_dirs]


Expand Down
4 changes: 2 additions & 2 deletions macsima2mc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def select_by_exposure(list_indices,exp_index=4,target='max'):

return selected_indices

def create_stack(cycle_info_df,output_dir,ref_marker='DAPI',hi_exp=False,ill_corr=False,extended_outputs=False):
def create_stack(cycle_info_df,output_dir,ref_marker='DAPI',hi_exp=False,ill_corr=False,out_folder='raw',extended_outputs=False):

if extended_outputs:
out=outputs_dic()
Expand All @@ -198,7 +198,7 @@ def create_stack(cycle_info_df,output_dir,ref_marker='DAPI',hi_exp=False,ill_cor
acq_index=select_by_exposure(acq_index)

for index in acq_index:
stack_output_dir=output_dir / cast_outdir_name(index) / 'staged'
stack_output_dir=output_dir / cast_outdir_name(index) / out_folder
( stack_output_dir ).mkdir(parents=True, exist_ok=True)
group=acq_group.get_group(index)
#use tile 1 as reference to determine the heigh and width of the tiles
Expand Down

0 comments on commit 87850ec

Please sign in to comment.