diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8a4fdfe..a5db9fc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,7 +15,7 @@ sphinx: # Optionally build your docs in additional formats such as PDF formats: [pdf] build: - os: ubuntu-20.04 + os: "ubuntu-22.04" tools: python: '3.11' python: diff --git a/autoafids/config/snakebids.yml b/autoafids/config/snakebids.yml index 6bda4c5..1afd915 100644 --- a/autoafids/config/snakebids.yml +++ b/autoafids/config/snakebids.yml @@ -235,8 +235,9 @@ resource_urls: #Stereotaxy models STN: 'resources/stereotaxy/STN.pkl' -cZI: 'resources/stereotaxy/STN.pkl' #change to czi model but dummy here for testing +cZI: 'resources/stereotaxy/cZI.pkl' template_fcsv: 'resources/stereotaxy/target_template.fcsv' +cZI_template_fcsv: 'resources/stereotaxy/cZI_target_template.fcsv' plugins.validator.skip: False root: results diff --git a/autoafids/resources/stereotaxy/cZI.pkl b/autoafids/resources/stereotaxy/cZI.pkl new file mode 100644 index 0000000..e1a58c7 Binary files /dev/null and b/autoafids/resources/stereotaxy/cZI.pkl differ diff --git a/autoafids/resources/stereotaxy/cZI_target_template.fcsv b/autoafids/resources/stereotaxy/cZI_target_template.fcsv new file mode 100644 index 0000000..0af39f6 --- /dev/null +++ b/autoafids/resources/stereotaxy/cZI_target_template.fcsv @@ -0,0 +1,5 @@ +# Markups fiducial file version = 4.11 +# CoordinateSystem = RAS +# columns = id,x,y,z,ow,ox,oy,oz,vis,sel,lock,label,desc,associatedNodeID +1,afid1_x,afid1_y,afid1_z,0,0,0,1,1,1,1,1,Predicted Right cZI ,vtkMRMLScalarVolumeNode1 +2,afid2_x,afid2_y,afid2_z,0,0,0,1,1,1,1,2,Predicted Left cZI,vtkMRMLScalarVolumeNode1 \ No newline at end of file diff --git a/autoafids/workflow/rules/stereotaxy.smk b/autoafids/workflow/rules/stereotaxy.smk index b0ad829..49906fa 100644 --- a/autoafids/workflow/rules/stereotaxy.smk +++ b/autoafids/workflow/rules/stereotaxy.smk @@ -1,15 +1,20 @@ stereotaxy_target = config["stereotaxy"] +def which_input(wildcards): + desc_val = "afidscnn-nnlm" if config.get("detect_mode") == "nnlm" else "afidscnn" + return bids( + root=root, + datatype="afids-cnn", + desc=desc_val, + suffix="afids.fcsv", + **inputs[config["modality"]].wildcards, + ) + + rule stereotaxy: input: - afidfcsv=bids( - root=root, - datatype="afids-cnn", - desc=_fcsv_desc, - suffix="afids.fcsv", - **inputs[config["modality"]].wildcards, - ), + afidfcsv=which_input, output: fcsv_native=bids( root=root, @@ -35,7 +40,14 @@ rule stereotaxy: params: model=str(Path(workflow.basedir).parent / config[stereotaxy_target]), midpoint="PMJ", - target_fcsv=str(Path(workflow.basedir).parent / config["template_fcsv"]), + target_fcsv=str( + Path(workflow.basedir).parent + / ( + config["cZI_template_fcsv"] + if stereotaxy_target == "cZI" + else config["template_fcsv"] + ) + ), conda: "../envs/skimage.yaml" script: