Skip to content

Commit

Permalink
Remove dead code (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen authored Sep 16, 2022
1 parent e9163f7 commit 32bfdb0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,11 @@ def build_input_node(self):
self.caps_directory, "groups", f"group-{self.parameters['group_label']}"
)
):
error_message = (
raise ClinicaException(
f"Group label {self.parameters['group_label']} already exists, "
f"please choose another one or delete the existing folder and "
f"also the working directory and rerun the pipeline"
)
raise ClinicaException(error_message)
# statistics_dir_tsv = os.path.join(input_directory, 'groups', group_id, 'statistics', 'participant.tsv')
# # Copy the subjects_visits_tsv to the result folder
# # First, check if the subjects_visits_tsv has the same info with the participant.tsv in the folder of statistics.
# # If the participant TSV does not exit, copy subjects_visits_tsv in the folder of statistics too,
# # if it is here, compare them.
# if not os.path.isfile(statistics_dir_tsv):
# copy(subjects_visits_tsv, statistics_dir_tsv)
# else:
# # Compare the two TSV files
# if not have_same_subjects(statistics_dir_tsv, subjects_visits_tsv):
# raise ValueError("It seems that this round of analysis does not contain the same subjects"
# "where you want to put the results, please check it!")

# Check input files before calling SurfStat with Matlab
# =====================================================
Expand Down
26 changes: 0 additions & 26 deletions clinica/utils/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,3 @@ def get_subject_session_list(

participant_ids, session_ids = read_participant_tsv(ss_file)
return session_ids, participant_ids


def have_same_subjects(tsv_file_1, tsv_file_2):
"""Return True if `tsv_file_1` and `tsv_file_2` have the same subjects, False otherwise."""
import pandas as pd

tsv_df_1 = pd.read_csv(tsv_file_1, sep="\t")
tsv_df_2 = pd.read_csv(tsv_file_2, sep="\t")
image_ids_1 = [
f"{p_id}_{s_id}"
for (p_id, s_id) in zip(
list(tsv_df_1.participant_id), list(tsv_df_1.session_id)
)
]
image_ids_2 = [
f"{p_id}_{s_id}"
for (p_id, s_id) in zip(
list(tsv_df_2.participant_id), list(tsv_df_2.session_id)
)
]
diff_image_ids = list(set(image_ids_1) - set(image_ids_2))

if len(diff_image_ids) == 0:
return True
else:
return False

0 comments on commit 32bfdb0

Please sign in to comment.