Skip to content

Commit

Permalink
Merge pull request #174 from sameeul/v072
Browse files Browse the repository at this point in the history
Update docs, version, remove unneccesary files
  • Loading branch information
sameeul authored Nov 29, 2023
2 parents 78046af + e45009f commit 24b6190
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 56 deletions.
29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ will print the dictionary

## Using Arrow for feature results

Nyxus provides the ability to get the results of the feature calculations in Arrow IPC and Parquet formats. Note that writing to Arrow is currently only supported by building from source and is not yet available in the PyPI wheels. It is recommended to use Conda for building with Arrow enabled.
Nyxus provides the ability to get the results of the feature calculations in Arrow IPC and Parquet formats.

To create an Arrow IPC or Parquet file, use the `create_arrow_ipc_file()` and `create_parquet_file()` methods on a Nyxus object. For example,
To create an Arrow IPC or Parquet file, use `output_type="arrowipc"` or `output_type="parquet"` in `Nyxus.featurize*` calls.
Optionally, an `output_path` argument can be passed to specify the location of the output file. For example,

```python
from nyxus import Nyxus
Expand Down Expand Up @@ -260,35 +261,19 @@ Nyxus provides the ability to get the results of the feature calculations in Arr

nyx = Nyxus(["*ALL_INTENSITY*"])

features = nyx.featurize(intens, seg)
arrow_file = nyx.featurize(intens, seg, output_type="arrowipc", output_path="some_path")

nyx.create_arrow_file()

arrow_file_path = nyx.get_arrow_ipc_file()

print(arrow_file_path)
print(arrow_file)

```

The output is:

```bash
out.arrow
```

Note that both of these methods have an optional argument for a path to be provided of where to write the file to. For example, `nyx.create_arrow_file('out/out.arrow')`. For Arrow IPC files, a memory mapping can be created to access the data without using additional memory. For example, using the same `intens` and `seg` data as before,

```python
nyx = Nyxus(["*ALL_INTENSITY*"])

features = nyx.featurize(intens, seg)

nyx.create_arrow_file()

arrow_array = nyx.get_arrow_memory_mapping()
NyxusFeatures.arrow
```

This functionality is also available in the through the command line using the flag `--outputType`. If this flag is set to `--outputType=arrow` then the results will be written to an Arrow IPC file in the output directory and `--outputType=parquet` will write to a Parquet file.
This functionality is also available in the through the command line using the flag `--outputType`. If this flag is set to `--outputType=arrowipc` then the results will be written to an Arrow IPC file in the output directory and `--outputType=parquet` will write to a Parquet file.

## Available features
The feature extraction plugin extracts morphology and intensity based features from pairs of intensity/binary mask images and produces a csv file output. The input image should be in tiled [OME TIFF format](https://docs.openmicroscopy.org/ome-model/6.2.0/ome-tiff/specification.html). The plugin extracts the following features:
Expand Down
26 changes: 5 additions & 21 deletions docs/source/cmdline_and_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ will print the dictionary
8. Using Arrow for feature results
-----------------------------------------------------------------------------

Nyxus provides the ability to get the results of the feature calculations in Arrow IPC and Parquet formats. To create an Arrow IPC or Parquet file, use the `create_arrow_ipc_file()` and `create_parquet_file()` methods on a Nyxus object. For example,
Nyxus provides the ability to get the results of the feature calculations in Arrow IPC and Parquet formats. To create an Arrow IPC or Parquet file, use `output_type="arrowipc"` or `output_type="parquet"` in `Nyxus.featurize*` calls.
Optionally, an `output_path` argument can be passed to specify the location of the output file.

.. code-block:: python
Expand Down Expand Up @@ -472,33 +473,16 @@ Nyxus provides the ability to get the results of the feature calculations in Arr
nyx = Nyxus(["*ALL_INTENSITY*"])
features = nyx.featurize(intens, seg)
nyx.create_arrow_file()
arrow_file_path = nyx.get_arrow_ipc_file()
print(arrow_file_path)
arrow_file = nyx.featurize(intens, seg, output_type="arrowipc", output_path="some_path")
print(arrow_file)
The output is:

.. code-block:: bash
out.arrow
Note that both of these methods have an optional argument for a path to be provided of where to write the file to. For example, `nyx.create_arrow_file('out/out.arrow')`. For Arrow IPC files, a memory mapping can be created to access the data without using additional memory. For example, using the same `intens` and `seg` data as before,

.. code-block:: python
nyx = Nyxus(["*ALL_INTENSITY*"])
features = nyx.featurize(intens, seg)
nyx.create_arrow_file()
arrow_array = nyx.get_arrow_memory_mapping()
some_path/NyxusFeatures.arrow
9. Nested Features Examples
-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Nyxus",
"version": "0.7.1",
"containerId": "polusai/nyxus:0.7.1",
"version": "0.7.2",
"containerId": "polusai/nyxus:0.7.2",
"title": "Nyxus feature extraction",
"description": "Nyxus feature extractor",
"author": "friskluft + hsidky",
Expand Down
2 changes: 1 addition & 1 deletion src/nyx/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#define VERSIONH_INCLUDED

#define PROJECT_NAME "Nyxus"
#define PROJECT_VER "0.7.1"
#define PROJECT_VER "0.7.2"

#endif // VERSIONH_INCLUDED
Binary file removed test_nyxus/nyxus.arrow
Binary file not shown.
10 changes: 0 additions & 10 deletions tests/download_data.py

This file was deleted.

0 comments on commit 24b6190

Please sign in to comment.