Coverage for ibllib/atlas/flatmaps.py: 71%

14 statements  

« prev     ^ index     » next       coverage.py v7.5.4, created at 2024-07-08 17:16 +0100

1"""Techniques to project the brain volume onto 2D images for visualisation purposes.""" 

2 

3from ibllib.atlas import deprecated_decorator 

4from iblatlas import flatmaps 

5 

6 

7@deprecated_decorator 

8def FlatMap(**kwargs): 

9 return flatmaps.FlatMap(**kwargs) 

10 

11 

12@deprecated_decorator 

13def circles(N=5, atlas=None, display='flat'): 

14 """ 

15 :param N: number of circles 

16 :param atlas: brain atlas at 25 m 

17 :param display: "flat" or "pyramid" 

18 :return: 2D map of indices, ap_coordinate, ml_coordinate 

19 """ 

20 

21 return flatmaps.circles(N=N, atlas=atlas, display=display) 

22 

23 

24@deprecated_decorator 

25def swanson(filename="swanson2allen.npz"): 

26 """ 

27 FIXME Document! Which publication to reference? Are these specifically for flat maps? 

28 Shouldn't this be made into an Atlas class with a mapping or scaling applied? 

29 

30 Parameters 

31 ---------- 

32 filename 

33 

34 Returns 

35 ------- 

36 

37 """ 

38 

39 return flatmaps.swanson(filename=filename) 

40 

41 

42@deprecated_decorator 

43def swanson_json(filename="swansonpaths.json", remap=True): 

44 """ 

45 Vectorized version of the swanson bitmap file. The vectorized version was generated from swanson() using matlab 

46 contour to find the paths for each region. The paths for each region were then simplified using the 

47 Ramer Douglas Peucker algorithm https://rdp.readthedocs.io/en/latest/ 

48 

49 Parameters 

50 ---------- 

51 filename 

52 remap 

53 

54 Returns 

55 ------- 

56 

57 """ 

58 return flatmaps.swanson_json(filename=filename, remap=remap)