The shape calculation device (10) includes a sensor (12) configured such that the amount of light detected for the wavelength corresponding to each of the plurality of detected portions (26) varies depending on the shape of each of the plurality of detected portions. A photodetector (16) that detects light amount information that is a relationship between the wavelength and the light amount acquired by using the light source, and a calculation unit (50) that performs calculations related to the shapes of the plurality of detection target parts based on the light amount information. Is provided. The shape calculation device (10) further changes the setting of changing the dynamic range of at least one of the intensity of light input to the sensor and the electrical signal generated by the photodetector based on the light output from the sensor. Part (40A, 42, 14A).形状演算装置(10)は、複数の被検出部(26)各々に応じた波長について検出される光量が複数の被検出部の各々の形状に応じて異なるように構成されたセンサ(12)を用いて取得された波長と光量との関係である光量情報を検出する光検出器(16)と、光量情報に基づき複数の被検出部の各々の形状に関わる演算を行う演算部(50)とを備える。形状演算装置(10)は、更に、センサに入力される光の強度、及びセンサから出力された光に基づき光検出器によって生成される電気信号、のうち少なくとも一方のダイナミックレンジを変更する設定変更部(40A,42,14A)を備える。