DCAN-Labs / BIBSnet

This BIDS App provides the utility of creating a nnU-Net anatomical MRI segmentation and mask with a infant brain trained model. It can easily be included in other processing pipelines and for circumventing JLF within Nibabies.
https://bibsnet.readthedocs.io/en/latest/
Apache License 2.0
3 stars 8 forks source link

CABINET is having an issue converting 6 month aged subjects to int #54

Closed henrycikanek closed 1 year ago

henrycikanek commented 1 year ago

What happened?

Essentially, when passing the 6 representing the age in months of my subject python is having an issue recognizing it as an int. Was initially trying to do this in a loop but then was attempting to bypass the issue by simpling running a single subject manually but ran into the same issue unfortunately. Sure it is not too complicated an error, but figured I'd get an extra pair of eyes. Thank you for all the help:)

What command did you use?

docker run -it \
    -v /Users/sealab/Documents/MRI/BABIES/Six_Month/bids:/input \
    -v /Users/sealab/Documents/MRI/BABIES/Six_Month/derivatives/CABINET:/output \
    -v /Users/sealab/Documents/MRI/BABIES/Six_Month/derivatives/work/cabinet_work:/work_tmp \
    -v /Users/sealab/Documents/MRI/BABIES/CABINET_parameter/parameter-file-container.json:/param_file.json \
    dcanumn/cabinet \
    /input /output participant \
    -participant 1503 \
    -ses sixmonth \
    -age 6 \
    -jargs /param_file.json \
    -end postbibsnet \
    -start prebibsnet \
    -w /work_tmp

What version of CABINET are you using?

dcanumn/cabinet latest e28757885510 2 months ago 38.6GB (I think 2.4 just updated 2 weeks ago)

Relevant log output

tsv_df.shape:  (2, 2)
tsv_df.columns:  Index(['session', 'age'], dtype='object')
Traceback (most recent call last):
  File "/home/cabinet/cabinet", line 1044, in <module>
    main()
  File "/home/cabinet/cabinet", line 69, in main
    json_args, sub_ses_IDs = get_params_from_JSON([get_stage_name(stg) for stg
  File "/home/cabinet/cabinet", line 211, in get_params_from_JSON
    return validate_cli_args(vars(parser.parse_args()), stage_names,
  File "/home/cabinet/cabinet", line 289, in validate_cli_args
    sub_ses_IDs[ix]["age_months"] = read_from_tsv(
  File "/home/cabinet/cabinet", line 519, in read_from_tsv
    desired_output = get_col_value_from_tsv(j_args, logger, tsv_path, ID_col, col_name, sub_ses)
  File "/home/cabinet/cabinet", line 557, in get_col_value_from_tsv
    return int(subj_row[col_name])
  File "/opt/conda/lib/python3.8/site-packages/pandas/core/series.py", line 185, in wrapper
    raise TypeError(f"cannot convert the series to {converter}")
TypeError: cannot convert the series to <class 'int'>


### Add any additional information or context about the problem here.

_No response_
audreymhoughton commented 1 year ago

Hi @henrycikanek , as I have specified before, please use the newest version of CABINET. Previously, I told you 2.4.0, but we also just released 2.4.2 yesterday. I also recommend taking a look at the new TSV documentation here: https://cabinet.readthedocs.io/en/stable/participants/ The usage changed between releases, so understandably, the codebase is having issues reading your TSV file.

henrycikanek commented 1 year ago

Sounds good! Thanks for the help, am updating now

henrycikanek commented 1 year ago

Hey, so I have updated to the latest version (2.4.2) and re-ran the manual command, however I received the same error unfortunately, any ideas what else I should check?

This was the command I used:

docker run -it \ -v /Users/sealab/Documents/MRI/BABIES/Six_Month/bids:/input \ -v /Users/sealab/Documents/MRI/BABIES/Six_Month/derivatives/CABINET:/output \ -v /Users/sealab/Documents/MRI/BABIES/Six_Month/derivatives/work/cabinet_work:/work_tmp \ -v /Users/sealab/Documents/MRI/BABIES/CABINET_parameter/parameter-file-container.json:/param_file.json \ dcanumn/cabinet:2.4.2 \ /input /output participant \ -participant 1503 \ -ses sixmonth \ -age 6 \ -jargs /param_file.json \ -end postbibsnet \ -start prebibsnet \ -w /work_tmp

error received:

`Traceback (most recent call last):

File "/home/cabinet/cabinet", line 1043, in main() File "/home/cabinet/cabinet", line 69, in main json_args, sub_ses_IDs = get_params_from_JSON([get_stage_name(stg) for stg File "/home/cabinet/cabinet", line 211, in get_params_from_JSON return validate_cli_args(vars(parser.parse_args()), stage_names, File "/home/cabinet/cabinet", line 289, in validate_cli_args sub_ses_IDs[ix]["age_months"] = read_from_tsv( File "/home/cabinet/cabinet", line 519, in read_from_tsv desired_output = get_col_value_from_tsv(j_args, logger, tsv_path, ID_col, col_name, sub_ses) File "/home/cabinet/cabinet", line 549, in get_col_value_from_tsv return int(subj_row[col_name]) File "/opt/conda/lib/python3.8/site-packages/pandas/core/series.py", line 185, in wrapper raise TypeError(f"cannot convert the series to {converter}") TypeError: cannot convert the series to <class 'int' `

henrycikanek commented 1 year ago

Have solved it:). Was the TSV's, thanks for the help!