Skip to content

Commit 2551dc5

Browse files
committed
added grid documents
1 parent c650b8c commit 2551dc5

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

doc/Grid.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
2+
# Copyright 2017-2019 University of Huddersfield.
3+
# Licensed under the BSD-3 License.
4+
# See license.md file in the project root for full license information.
5+
# This project has received funding from the European Research Council (ERC)
6+
# under the European Union’s Horizon 2020 research and innovation programme
7+
# (grant agreement No 725899).
8+
---
9+
digest: Constrain a 2D DataSet into a Grid.
10+
sc-categries: Dimensionality Reduction, Data Processing
11+
sc-related: Classes/FluidMDS, Classes/FluidPCA, Classes/FluidUMAP, Classes/FluidDataSet
12+
see-also:
13+
description: |
14+
Maps a set of 2D points in a :fluid-obj:`DataSet` to a rectangular grid using a variant of the jonker-volgenant algorithm(https://www.gwern.net/docs/statistics/decision/1987-jonker.pdf). It can be useful to obtain compact grid layouts from the output of dimensionality reduction algorithms such as :fluid-obj:`UMAP`, :fluid-obj:`PCA` or :fluid-obj:`MDS`. This is similar to projects like CloudToGrid (https://github.com/kylemcdonald/CloudToGrid/), RasterFairy (https://github.com/Quasimondo/RasterFairy) or IsoMatch (https://github.com/ohadf/isomatch).
15+
16+
parameters:
17+
oversample:
18+
description: |
19+
A factor to oversample the destination grid. The default is 1, so the grid has the same number of points as the input. Factors of 2 or more will allow a larger destination grid, which will respect the original shape a little more, but will also be sparser.
20+
extent:
21+
description: |
22+
The size to which the selected axis will be constrained. The default is 0, which turns the constraints off.
23+
axis:
24+
description: |
25+
The axis to which the extent constraint is applied. The default 0 is horizontal, and 1 is vertical.
26+
27+
messages:
28+
fitTransform:
29+
description: |
30+
Fit the model to a :fluid-obj:`DataSet` and write the new projected data to a destination FluidDataSet.
31+
args:
32+
- name: sourceDataSet
33+
description: |
34+
Source data, or the DataSet name
35+
- name: destDataSet
36+
description: |
37+
Destination data, or the DataSet name
38+
- name: action
39+
description: |
40+
Run when done

src/clients/Grid/CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required(VERSION 3.3)
2+
3+
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../script/dump-pretarget.cmake)
4+
5+
# set(CMAKE_CXX_STANDARD 11)
6+
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
add_executable(
8+
${PROJECT_NAME}
9+
${PROJECT_NAME}.cpp
10+
)
11+
# target_link_libraries(${PROJECT_NAME} FLUID_DECOMPOSITION)
12+
# target_include_directories(
13+
# ${PROJECT_NAME}
14+
# PRIVATE
15+
# "${CMAKE_CURRENT_SOURCE_DIR}/../../include"
16+
# )
17+
#
18+
# target_include_directories(
19+
# ${PROJECT_NAME}
20+
# SYSTEM PRIVATE
21+
# "${C74_MAX_INCLUDES}"
22+
# "${C74_MSP_INCLUDES}"
23+
# "${C74_JIT_INCLUDES}"
24+
# )
25+
26+
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../script/dump-posttarget.cmake)

src/clients/Grid/Grid.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <clients/nrt/GridClient.hpp>
2+
#include <FluidParameterDump.hpp>
3+
int main(int argc, char *argv[]) {
4+
using namespace fluid::client;
5+
if (!argc) std::cerr << "Please pass a folder to write to";
6+
std::cout << "Write JSON to " << argv[1];
7+
ParameterDump<NRTThreadedGridClient>::dump("Grid", argv[1]);
8+
return 0;
9+
}

0 commit comments

Comments
 (0)