Neurocaps

Latest version: v0.21.0

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 19

0.14.7

♻ Changed
- Improved Warning Messages and Print Statements:
- In TimeseriesExtractor.get_bold, the subject-specific information output has been reformatted for better readability:

- Previous Format:

Subject: 1; run:1 - Message


- New Format:

[SUBJECT: 1 | SESSION: 1 | TASK: rest | RUN: 1]
-----------------------------------------------
Message


- In `CAP` class numerous warnings and statements have been changed to improve clarity:

- Previous Format:

Optimal cluster size using silhouette method for A is 2.


- New Format:

[GROUP: A | METHOD: silhouette] - Optimal cluster size is 2.


- These changes should improve clarity when viewing in a terminal or when redirected to an output file by SLURM.
- Language in many statements and warnings have also been improved.

0.14.6

🐛 Fixes
- For `CAP.get_caps`, when `cluster_selection_method` was used to find the optimal cluster size, the model would be
re-estimated and stored in the `self.kmeans` property for later use. Previously, the internal function that generated the
model using scikit's `KMeans` only returned the performance metrics. These metrics for each cluster size were assessed,
and the best cluster size was used to generate the optimal KMeans model with the same parameters. This is fine when
setting `random_state` with the same k since the model would produce the same initial cluster centroids and produces similar
clustering solution regardless of the number of times the model is re-generated. However, if a random state was not used,
the newly re-generated optimal model would technically differ despite having the same k, due to the random nature of KMeans
when initializing the cluster centroids. Now, the internal function returns both the performance metrics and the models,
ensuring the exact same model that was assessed is stored in the `self.kmeans`. Shouldn't be an incredibly major issue
if your models are generally stable and produce similar cluster solutions. Though when not using a random state, even
minor differences in the kmeans model even when using the same k can produce some statistical differences. Ultimately,
it is always best to ensure that the same model that the same model used for assessment and for later analyses are the
same to ensure robust results.

0.14.5

♻ Changed
- In `TimeseriesExtractor`, `dummy_scans` can now be a dictionary that uses the "auto" sub-key if "auto" is set to
True, the number of dummy scans removed depend on the number of "non_steady_state_outlier_XX" columns in the
participants fMRIPrep confounds tsv file. For instance, if there are two "non_steady_state_outlier_XX" columns
detected, then `dummy_scans` is set to two since there is one "non_steady_state_outlier_XX" per outlier volume for
fMRIPrep. This is assessed for each run of all participants so ``dummy_scans`` depends on the number number of
"non_steady_state_outlier_XX" in the confound file associated with the specific participant, task, and run number.
🐛 Fixes
- For defensive programming purposes, instead of assuming the timing information in the event file perfectly
coincides with the timeseries. When a condition is specified and onset and duration must be used to extract the
indices corresponding to the condition of interest, the max scan index is checked to see if it exceeds the length of
the timeseries. If this condition is met, a warning is issued in the event of timing misalignment (i.e errors in event
file, incorrect repetition time, etc) and invalid indices are ignored to only extract the valid indices from the timeseries.
This is done in the event this was that are greater than the timeseries shape are ignored.

0.14.4

♻ Changed
- Minor update that prints the optimal cluster size for each group when using `cluster_selection_method` in
`CAP.get_caps`. Just for information purposes.
- When error raised due to kneed not being able to detect the elbow, the group it failed for is now stated.
- Previously version 0.14.3.post1

0.14.3.post1

♻ Changed
- Minor update that prints the optimal cluster size for each group when using `cluster_selection_method` in
`CAP.get_caps`. Just for information purposes.
- When error raised due to kneed not being able to detect the elbow, the group it failed for is now stated.
- Yanked due to not being a metadata update, this should be a patch update to denote a behavioral change,
this is now version 0.14.4 to adhere a bit better to versioning practices.

0.14.3

- Thought of some minor changes.

♻ Changed
- Added new warning if `fd_threshold` is specified but `use_confounds` is False since `fd_threshold` needs the confound
file from fMRIPrep. In previous version, censoring just didn't occur and never issued a warning.
- Changed the error exception types for cosine similarity in `CAP.caps2radar` from ValueError to ZeroDivisionError
- Added ValueError in `TimeseriesExtractor.visualize_bold` if both `region` and `roi_indx` is None.
- In `TimeseriesExtractor.visualize_bold` if `roi_indx` is a string, int, or list with a single element, a title is
added to the plot.

Page 10 of 19

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.