Split PDF files easily using Ubuntu scripts

One of the fun parts of reinstalling an OS (yes, I think it is fun!), is to discover new software and new ways of doing things. As such, it works as a “digital shower”, getting rid of unnecessary stuff that has piled up.

Trying to also get rid of some physical mess, I am scanning some piles of paper documents. This leaves me with some large multi-page PDFs that I would like to split up easily. In the spirit of software carpentry I looked for a simple solution for splitting up a PDF file, and came across the command “burst” in the little terminal application pdftk. To use it on Ubuntu, you will first need to install it, using the terminal command:

sudo apt update && sudo apt install pdftk

Then this one-liner is all that is necessary to split a PDF file into a series of individual PDFs:

pdftk your-file.pdf burst

For convenience, I also made it into a small Ubuntu script:

This script can run by right-clicking on a file in the file manager:

And the end-result is a series of individual PDF files:

And then you can of course also combine the files again, either all PDFs:

pdftk *.pdf cat output newfile.pdf

or only the files you like:

pdftk file1.pdf file2.pdf cat output newfile.pdf

Starting afresh

After four years as Head of Department (of Musicology at UiO), I am going back to my regular associate professor position in January. It has been a both challenging and rewarding period as HoD, during which I have learned a lot about managing people, managing budgets, understanding huge organizations, developing strategies, talking to all sorts of people at all levels in the system, and much more.

I am happy to hand over a Department in growth to the new HoD (Peter Edwards). We have implemented a new bachelor’s program, launched UiO’s first MOOC (Music Moves), and hired a number of new people, just to mention a few of the things I have worked on over the last years. I am also proud that we just got our new appointment plan approved before Christmas, aiming at hiring up to seven new professors within the next five years. Humanities departments are under a lot of pressure these days, so I am very grateful that we are in a position to expand in the coming years!

I have only been teaching sporadically while being HoD, so I am excited about getting back to running the course Interactive Music that I started up a while back. This is a so-called “practical-theoretical” course, aiming at giving students a holistic perspective on designing musical instruments and systems. I published a paper on the design of this course a few years ago (An action–sound approach to teaching interactive music), and have since gathered some more ideas that I want to test out when it comes to teaching students a combination of music cognition and technology focused around some concrete designs. I also hope that these ideas will turn into my next book project, if successful.

I am also excited about starting up ny new research project MICRO – Human Bodily Micromotion in Music Perception and Interaction, in which we will focus on how music influences us when at rest. Fortunately, the fourMs lab is really getting up to speed now, so we will really be able to study micromotion in great detail.

In getting ready for my new working life, I decided to wipe my main computer (a Lenovo Yoga Pro 2) yesterday. I have been running various versions of Ubuntu over the last years (Ubuntu Studio, Ubuntu GNOME, and Linux Mint), but decided to go for the regular Ubuntu 16.10 this time around. I think Unity has matured quite a bit now, and works very well on the Yoga’s multitouch HiDPI display. This was my first complete reinstall since I got the laptop almost three years, and was definitely needed. I always test a lot of different software and settings, so the system had gotten clogged up by lots of weird stuff on top of each other. The new clean system definitely feels smooth and well-functioning. It feels like a digital and mental “shower”, getting ready for the new year!

New PhD Fellowship in the fourMs group

Come work with us in the fourMs group at University of Oslo:

Doctoral Research Fellowship is available in the fourMs group.

All proposals within the area of music cognition will be considered, but we are particularly looking for projects on the topical areas of the fourMs group, such as music-related body motion, cross-modal relationships of sound and motion, rhythm studies, and music and emotions. The appointed candidate will get full access to the world-class fourMs lab, with state-of-the-art motion capture systems and sound spatialisation facilities. It is expected that the candidate will work on an independent project and be supervised by one or more members of the fourMs group, as well as other researchers at the Department of Musicology, depending on the particular focus of the project.

More information in the announcement.

Participating in the opening of The Guild

I participated in the opening of the Guild of Research Universities in Brussels yesterday. The Guild is

a transformative network of research-led universities from across the European continent, formed to strengthen the voice of universities in Europe, and to lead the way through new forms of collaboration in research, innovation and education.

The topic of the opening symposium is that of Open Innovation, a hot topic these days, and something that the European Commission is putting a lot of pressure on. I was invited to present an example of how open research can lead to innovation and to participate in a panel discussion. Below is an image of the setting, in the lovely Solvay Library in the heart of Brussels (and great to see that the 360-degree plugin works in WordPress!):


Ole Petter Ottersen, Chair of The Guild and Rector of the University of Oslo opened the symposium (click and drag to rotate image).

From basic music research to hospital application

In the symposium I showed a shortened version of the TV documentary that tells the unlikely story of how my basic music research has led to medical innovation. In 2005 I developed a method for visualizing the movements of dancers – motiongrams – with a set of accompanying software tools. As an open source advocate, I made these software tools freely available online, and witnessed how my code was picked up by artists, designers, hackers and researchers. Now my method is at the core of the system Computer-based Infant Movement Assessment (CIMA). This is a clinical system currently being tested in hospitals around the world, with the aim of detecting early-born infants’ risk of developing cerebral palsy.

Panel discussion

The panel discussion centered mainly on policy, and it was great to see that both European university leaders and the Commission embrace openness in all its entirety. Head of Cabinet Antonio Vicente effectively argued that Europe started late, but is quickly catching up in pushing for openness (access, data, research, innovation). The question is now how we get to do this.

I think that the EU should get a lot of credit for their brave move within open research, but individual universities need to push for the same type of openness throughout their institutions. Perhaps the biggest challenge is to change the mentality of peers, who ultimately are the key persons in making decisions as to who should get project funding, appointments and promotions. I see that we often fail in recruiting young researchers with an inclination towards open research. Such applicants consistently get evaluated as “weaker” in comparison with researchers that are following more traditional academic pathways.

Moving forwards, we need to continue with an (inter)national push, but we should not forget about the need for a culture change among individuals. This is something we need to work on at an institutional level.


A view from my panel position during the symposium (click and drag to rotate image).

From Basic Music Research to Medical Tool

The Research Council of Norway is evaluating the research being done in the humanities these days, and all institutions were given the task to submit cases of how societal impact. Obviously, basic research is per definition not aiming at societal impact in the short run, and my research definitely falls into category.Still it is interesting to see that some of my basic research is, indeed, on the verge of making a societal impact in the sense that policy makers like to think about. So I submitted the impact case “From Music to Medicine”, based on the system Computer-based Infant Movement Assessment (CIMA).

Musical Gestures Toolbox

CIMA is based on the Musical Gestures Toolbox, which started its life in the early 2000s, and which (in different forms) has been shared publicly since 2005.

My original aim of developing the MGT was to study musicians’ and dancers’ motion in a simple and holistic way.The focus was always on trying to capture as much relevant information as possible from a regular video recording, with a particular eye on the temporal development of human motion.

The MGT was first developed as standalone modules in the graphical programming environment Max, and was in 2006 merged into the Jamoma framework. This is a modular system developed and used by a group of international artists, under the lead of Timothy Place and Trond Lossius. The video analysis tools have since been used in a number of music/dance productions worldwide and are also actively used in arts education.

Studying ADHD

In 2006, I presented this research at the annual celebration of Norwegian research in the Oslo concert hall, after which professor Terje Sagvolden asked to test the video analysis system in his research on ADHD/ADD at Oslo University Hospital. This eventually lead to a collaboration in which the Musical Gestures Toolbox was used to analyse 16 rat caves in his lab. The system was also tested in the large-scale clinical ADHD study at Ullevål University Hospital in 2008 (1000+ participants). This collaboration ended abruptly with Sagvolden’s decease in 2011.

Studying Cerebral Palsy

The unlikely collaboration between researchers in music and medicine was featured in a newspaper article and a TV documentary in 2008, after which physiotherapist Lars Adde from the Department of Laboratory Medicine, Women’s and Children’s Health at the Norwegian University of Science and Technology (NTNU) called me to ask whether the tools could also be used to study infants. This has led to a long and fruitful collaboration and the development of the prototype Computer-based Infant Movement Assessment (CIMA) which is currently being tested in hospitals in Norway, USA, India, China and Turkey. A pre-patent has been filed and the aim is to provide a complete video-based solution for screening infants for the risk of developing cerebral palsy (CP).

It is documented that up to 18% of surviving infants who are born extremely preterm develop cerebral palsy (CP), and the total rate of neurological impairments is up to 45%. Specialist examination may be used to detect infants in the risk of developing CP, but this resource is only available at some hospitals. The CIMA aims to offer a standardised and affordable computer-based screening solution so that a much larger group of infants can be screened at an early stage, and the ones that fall in the risk zone may receive further specialist examination. Early intervention is critical to improving the motor capacities of the infants. The success of the CIMA methods developed on the MGT framework are to a large part based on the original focus on studying human motion through a holistic, simple and time-based approach.

The unlikely collaboration was featured in a new TV documentary in 2014.

References

  • Valle, S. C., Støen, R., Sæther, R., Jensenius, A. R., & Adde, L. (2015). Test–retest reliability of computer-based video analysis of general movements in healthy term- born infants. Early Human Development, 91(10), 555–558. http://doi.org/10.1016/j.earlhumdev.2015.07.001
  • Jensenius, A. R. (2014). From experimental music technology to clinical tool. In K. Stens\a eth (Ed.), Music, health, technology, and design. Oslo: Norwegian Academy of Music. Retrieved from http://urn.nb.no/URN:NBN:no-46186
  • Adde, L., Helbostad, J., Jensenius, A. R., Langaas, M., & Støen, R. (2013). Identification of fidgety movements and prediction of CP by the use of computer- based video analysis is more accurate when based on two video recordings. Physiotherapy Theory and Practice, 29(6), 469–475. http://doi.org/10.3109/09593985.2012.757404
  • Jensenius, A. R. (2013). Some video abstraction techniques for displaying body movement in analysis and performance. Leonardo, 46(1), 53–60. http://urn.nb.no/URN:NBN:no-38076
  • Adde, L., Langaas, M., Jensenius, A. R., Helbostad, J. L., & Støen, R. (2011). Computer Based Assessment of General Movements in Young Infants using One or Two Video Recordings. Pediatric Research, 70, 295–295. http://doi.org/10.1038/pr.2011.520
  • Adde, L., Helbostad, J. L., Jensenius, A. R., Taraldsen, G., Grunewaldt, K. H., & Støen, R. (2010). Early prediction of cerebral palsy by computer-based video analysis of general movements: a feasibility study. Developmental Medicine & Child Neurology, 52(8), 773–778. http://doi.org/10.1111/j.1469-8749.2010.03629.x
  • Adde, L., Helbostad, J. L., Jensenius, A. R., Taraldsen, G., & Støen, R. (2009). Using computer-based video analysis in the study of fidgety movements. Early Human Development, 85(9), 541–547. http://doi.org/10.1016/j.earlhumdev.2009.05.003
  • Jensenius, A. R. (2007). Action–Sound: Developing Methods and Tools to Study
    Music-Related Body Movement (PhD thesis). University of Oslo.
    http://urn.nb.no/URN:NBN:no-18922

Alexander Refsum Jensenius