         value.toFixed(2)
     
     # Highlights the bolus arrival tick mark.
+    #
+    # @param chart the intensity chart
     $scope.highlightBolusArrival = (chart) ->
+      # TODO - move this function to a directive.
+      
       # Select the SVG element.
       svg = d3.select(chart.container)
       # The x axis element.

      # TODO - draw the x axis line.
      line = svg.append('line')
    
    # Adds the fetched subject detail into the given subject.
    addDetail = (detail, subject) ->
      # The default modeling format is Chart for more than
      # one session, Table otherwise.
      defaultModelingFormat = (subject) ->
        if subject.sessions.length > 1 then 'Chart' else 'Table'

      # Fix the session and encounter dates.
      Helpers.fixDate(sess, 'acquisition_date') for sess in detail.sessions
      Helpers.fixDate(enc, 'date') for enc in detail.encounters
      # Copy the detail content into the subject.
      ControllerHelper.copyContent(detail, subject)
      # Flag indicating whether there is more than one session.
      subject.multiSession = subject.sessions.length > 1
      # The modeling display format, Chart or Table.
      $scope.modelingFormat = defaultModelingFormat(subject)
      # Place the subject in scope.
      $scope.subject = subject
      # End of the addDetail function.

    # If there is a detail id, then fetch the detail.
    # Otherwise, fetch the subject and then the detail.
    if subject.detail
      ControllerHelper.getDetail(subject, Subject, addDetail)
    else
      Subject.get(subject).$promise
        .then (fetched) ->
          subject.detail = fetched.detail
          ControllerHelper.getDetail(subject, Subject, addDetail)

    ControllerHelper.cleanBrowserUrl(subject.project)
]


# The controller helper methods.
ctlrs.factory 'ControllerHelper', ['$location', ($location) ->
  # Replaces the browser URL search parameters to include at most
  # a non-default project, since all other search parameters are
  # redundant.
