Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# v0.9.4 (Upcoming)

## Removals, Deprecations and Changes
* Removed the deprecated `plane_name` and `fallback_sampling_frequency` parameters from `ScanImageImagingInterface`. Use `plane_index` instead of `plane_name`. [PR #1688](https://github.com/catalystneuro/neuroconv/pull/1688)
* Changed the default value of `interleave_slice_samples` in `ScanImageImagingInterface` from `True` to `False`. [PR #1688](https://github.com/catalystneuro/neuroconv/pull/1688)
* Removed the deprecated `iterator_type='v1'` option from `_imaging_frames_to_hdmf_iterator`. Use `iterator_type='v2'` (default) instead. [PR #1679](https://github.com/catalystneuro/neuroconv/pull/1679)
* Removed support for passing `rate` in trace metadata for fluorescence traces. The rate is now always calculated automatically from the segmentation extractor's timestamps or sampling frequency. [PR #1679](https://github.com/catalystneuro/neuroconv/pull/1679)
* Removed the deprecated `stub_frames` parameter from ophys interfaces (`BaseImagingExtractorInterface`, `BaseSegmentationExtractorInterface`, `BrukerTiffMultiPlaneConverter`, `BrukerTiffSinglePlaneConverter`, `MiniscopeConverter`, `Suite2pSegmentationInterface`, `MinianSegmentationInterface`, `MiniscopeImagingDataInterface`). Use `stub_samples` instead. [PR #1676](https://github.com/catalystneuro/neuroconv/pull/1676)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def __init__(
plane_index: Optional[int] = None,
file_paths: Optional[list[FilePath]] = None,
interleave_slice_samples: Optional[bool] = None,
plane_name: str | None = None,
fallback_sampling_frequency: float | None = None,
verbose: bool = False,
):
"""
Expand Down Expand Up @@ -95,11 +93,7 @@ def __init__(
number of samples by frames_per_slice. This treats each slice_sample as a distinct sample.
- If False: Requires a specific slice_sample to be provided when frames_per_slice > 1.
- This parameter has no effect when ``frames_per_slice = 1`` or when ``slice_sample`` is provided.
- Default is True for backward compatibility (will change to False after November 2025).
plane_name : str, optional
Deprecated. Use plane_index instead. Will be removed in or after November 2025.
fallback_sampling_frequency : float, optional
Deprecated. Will be removed in or after November 2025.
- Default is False.
verbose : bool, default: False
If True, will print detailed information about the interface initialization process.
"""
Expand All @@ -111,8 +105,6 @@ def __init__(
"plane_index",
"file_paths",
"interleave_slice_samples",
"plane_name",
"fallback_sampling_frequency",
"verbose",
]
num_positional_args_before_args = 1 # file_path
Expand All @@ -138,10 +130,6 @@ def __init__(
plane_index = positional_values.get("plane_index", plane_index)
file_paths = positional_values.get("file_paths", file_paths)
interleave_slice_samples = positional_values.get("interleave_slice_samples", interleave_slice_samples)
plane_name = positional_values.get("plane_name", plane_name)
fallback_sampling_frequency = positional_values.get(
"fallback_sampling_frequency", fallback_sampling_frequency
)
verbose = positional_values.get("verbose", verbose)

file_paths = [Path(file_path)] if file_path else file_paths
Expand All @@ -152,25 +140,8 @@ def __init__(
f"Most likely this is a legacy version, use ScanImageLegacyImagingInterface instead."
)

# Backward compatibility flag - will be set to False after November 2025
if interleave_slice_samples is None:
interleave_slice_samples = True
warnings.warn(
"interleave_slice_samples currently set to True for backward compatibility. \n"
"This will be set to False by default in or after November 2025."
)

if plane_name is not None:

warnings.warn(
"The `plane_name` argument is deprecated and will be removed in or after November 2025. Use `plane_index` instead."
)
plane_index = int(plane_name)

if fallback_sampling_frequency is not None:
warnings.warn(
"The `fallback_sampling_frequency` argument is deprecated and will be removed in or after November 2025"
)
interleave_slice_samples = False

self.channel_name = channel_name
self.plane_index = plane_index
Expand Down
6 changes: 3 additions & 3 deletions tests/test_on_data/ophys/test_imaging_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ def test_incorrect_channel_name(self):
):
ScanImageImagingInterface(file_path=file_path, channel_name=channel_name, interleave_slice_samples=True)

def test_incorrect_plane_name(self):
"""Test that ValueError is raised when incorrect plane name is specified."""
def test_incorrect_plane_index(self):
"""Test that ValueError is raised when incorrect plane index is specified."""
file_path = str(OPHYS_DATA_PATH / "imaging_datasets" / "ScanImage" / "scanimage_20220801_volume.tif")
with pytest.raises(ValueError, match=r"plane_index \(20\) must be between 0 and 19"):
ScanImageImagingInterface(file_path=file_path, plane_name="20")
ScanImageImagingInterface(file_path=file_path, plane_index=20, interleave_slice_samples=True)


@pytest.mark.skipif(platform.machine() == "arm64", reason="Interface not supported on arm64 architecture")
Expand Down
Loading